Zelig Planet

L'esperienza è quella cosa meravigliosa che ti permette di riconoscere uno sbaglio quando lo ripeti. (F. P. Jones)

Home Page - Blog - Informazioni

Archivio

cerca un articolo inserendo una o più parole qui sotto:

oppure seleziona un mese dall'elenco:

oppure scegli una categoria di articoli:

oppure visualizza la pagina dell'archivio

Misc

Feed RSS 0.92 Feed RSS 2.0 RSS 2.0 comm. Feed Atom 0.3 XHTML valido CSS valido Sottoscrivi con Bloglines

Powered by
WordPress 2.0.7

Wordpress plugin: Zelig Dropdown Links

Sabato 5 Agosto 2006 by Zelig

english italian Articolo multilingue / Multilanguage post

This plugin is similar to the Zelig dropdown cats one, and it’s also an answer to some requests of my readers.

It displays the links in the sidebar as a simple dropdown list (select box). If you have more link categories, every one will be shown in it’s own list.
This is supposed to replace the original get_links_list() function and should be useful if you have a lot of links, but you don’t want to clutter up your sidebar with them!

INSTRUCTIONS:

  1. Download the zip file containing the plugin. There are two versions, both with equal functionality, to choose depending on the WordPress version you are using:
    Zelig Dropdown Links 1.2 - For WP 2.1 (and following, I hope…);
    Zelig Dropdown Links 1.1 - For previous WP versions.
  2. Extract the zelig-dropdown-links.php file into the plugins directory in your WordPress installation (wp-content/plugins).
  3. Log in to WordPress administration. Go to the Plugins page and Activate this plugin.
  4. Put this code somewere in your template page, outside the loop (usually in sidebar):
<?php zelig_dropdown_links(); ?>

The zelig_dropdown_links() function has some parameters you can pass (please note that options syntax is changed from version 1.0):

Parameter Values Description Default
boxwidth number width size (in pixel) of the list box. If you don’t use this parameter or if you set it to 0, the list box will assume the width of the longest category name it contains. If you set a width value, longer names may be truncated at that point, depending on browser (IE6…) 0
exclude number or comma separated list of numbers link category or categories (ID numbers) to hide. If not set or set to 0, all link categories will be displayed. 0
include number or comma separated list of numbers link category or categories (ID numbers) to display. If not set or set to 0, all link categories will be displayed. 0
title 0
1
set to 0 if you don’t want the first row of the list as a title with the name of the link category (text appearing in the list box when it’s closed). 1

EXAMPLES:

<?php zelig_dropdown_links('boxwidth=120'); ?>

Set the width of the list to 120 pixels.

<?php zelig_dropdown_links('boxwidth=120&exclude=1'); ?>

Set the width of the list to 120 pixels and hide link category with ID 1.

<?php zelig_dropdown_links('boxwidth=120&exclude=1,2,3'); ?>

Set the width of the list to 120 pixels and hide link categories with ID 1, 2 and 3.

<?php zelig_dropdown_links('include=1&title=0'); ?>

Display only link category with ID 1 and without the category name as a list “title”.

This plugin, due to the peculiarity of the type of visualization, ignores a lot of elements of Wordpress links, like image, description, score, target and rel. Only URI, name, visibility, sorting type and category limit are used.

NOTES:

You can use more than one istance of the function in the same page (provided that not showing the same links).
The output code is valid XHTML Strict.
Tested with WordPress from 2.0.4 to 2.1 only.

CHANGE LOG:

  • Version 1.2 (february 16, 2007): Wordpress 2.1 compatibile.
  • Version 1.1 (january 17, 2007): added “exclude”, “include” and “title” options.

Look here for all the Wordpress plugins from Zelig!

Ci sono 65 commenti a questo articolo

  1. Gravatar Commento di moieu   (2 commenti)

    Hi,

    I installed your lovely plugin “dropdown” :thumbup: but I tried to exclude a category but it did not work I included the line as:

    Is that correct? If not how can I do it?Thus, I am using links dropdown plugin.

    Last request, where can I find an archieve dropdown plugin?

  2. Gravatar Commento di moieu   (2 commenti)

    Another question :twisted:

    How can I delete the old links lists from the sidebar?

  3. Gravatar Commento di Zelig   (410 commenti)

    Moieu, I supose in your first question you’re talking about my “dropdown cats” plugin, not this one, right? Anyway, I can’t see the code line in your comment, so maybe it’s better if you write me an email
    About archives, you don’t need a plugin: just use this code.
    About old links, just delete the line with the get_links_list() function call from the sidebar.php file.

  4. Gravatar Commento di jayne dArcy   (2 commenti)

    Zelig, this is terrific! Now I can use WP’s internal link system and not have to beat my head in over their screwey styling (which always messes up my themes). You’re positively brilliant!

  5. Gravatar Commento di Zelig   (410 commenti)

    Thank you, Jayne!

  6. Gravatar Commento di Lois   (1 commento)

    I placed it on my sie and keep getting an error. I would appreciate if you could have lok. Thanks

  7. Gravatar Commento di Zelig   (410 commenti)

    Lois, I can’t see any error on your site at present (but I suppose you’ve disabled this plugin). Please explain me better your problem, if you still need help!

  8. Gravatar Commento di Shine   (1 commento)

    Hi there,

    The exact widget I was looking for… Had some trouble as I put the code in without the boxwidth option and for some reason my blog wanted it to have it.. so lucky I thought to try it with it in!
    My question… can I modify it to open the links in a new window?

    Thanks,
    Shine

  9. Gravatar Commento di Zelig   (410 commenti)

    @Shine: it is possible to modify the code to have the links opened in a new window, but I don’t recommend it because you can have some problems with that: for example, some “popup-stopper” could block it and Mozilla Firefox opens it in a new instance rather than in a new tab.
    Anyway, maybe I’ll add this option in future releases and let people choose!

  10. Gravatar Commento di Francesco   (4 commenti)

    Davvero tnx ho trovato il codice rieditato ed ora è valid XHTML
    finalmente trovo qlc che gli interessa e crede nella filosofia di fare pagine compatibili con tutti i browser e veloci da caricare ecc anche se il discorso è molto piu’ lungo
    ciau

  11. Gravatar Commento di Zelig   (410 commenti)

    Io sono un maniaco della validazione! :lol:

  12. Gravatar Commento di zoneX   (4 commenti)

    Anch’io :wall:
    ma passando al serio ‘ veramente positivo farlo.
    Solide basi e accessibilità molto piu’ facile per tutti.
    Per non parlare della banda risparmiata
    ciao :whistle:

  13. Gravatar Commento di michael lines   (1 commento)

    Sorry to be so dense, but I cannot find a “template” file. I found something called “templates” in the wp-admin folder, but adding your text has no effect… it may help me to know what you mean by “outsid e the loop (usually in the sidebar)”. My sidebar has its own file….
    Thanks for any help.

  14. Gravatar Commento di Zelig   (410 commenti)

    You’re on the right way, michael. There’s not a template file, but template folders. Just edit your sidebar.php file in that folder and add the required code.

  15. Gravatar Commento di Elyse   (1 commento)

    Zelig -

    I LOVE this plugin! :thumbup: I am currently helping a friend with her blog and she is utilizing the WP Link Manager and has five different link categories. Is there a way to have it only pull up one Link Category at a time? If you look at the site you’ll see the right nav has image headers for each link category and I’d like to have a separete drop down for each.

    Thanks in advanced!
    Elyse :mrgreen:

  16. Gravatar Commento di Zelig   (410 commenti)

    @Elyse: no way at present, sorry. Maybe next version…

  17. Gravatar Commento di elena   (1 commento)

    Ciao, volevo chiederti… avendo più categorie di links…c’è modo di far affiancare le diverse tendine in orizzontale invece che metterle una sotto l’altra? (vorrei inserirli non nella sidebar ma nel footer)
    grazie :)
    elena

  18. Gravatar Commento di Zelig   (410 commenti)

    Elena, ho pravato a pasticciare un po’ con i CSS e anche con il codice del plugin, ma non ci sono riuscito nemmeno io, mi dispiace… :(
    Magari quando mi capita un po’ più di tempo libero ci torno sopra con più calma.

  19. Gravatar Commento di Dave   (2 commenti)

    Hi, any chance of adding ability to exclude link categories, and also to sort by name? I have links that I only want to appear on inside pages. I can call them there with wp_get_linksbyname. But I would like to exclude them on the home page where I use the dropdown.
    Thanks for both dropdown plugins.

  20. Gravatar Commento di Adrian   (4 commenti)

    this plugins is great!
    i use it for my blog and it’s working just like what i want
    thanks brother!

  21. Gravatar Commento di Zelig   (410 commenti)

    Rilasciata una nuova versione del plugin (1.1)
    Plugin’s new version released (1.1)

    This should help Elise, Elena and Dave, I hope! ;-)

  22. Gravatar Commento di Dave   (2 commenti)

    Bravo!! With the combination of include and exclude, I can control what goes where and the order. This is perfect. Thank you again. :cheers:

  23. Trackback da Soporte-Wordpress
  24. Gravatar Commento di Peter   (1 commento)

    Hi,
    Is this compatible with Wordpress v 2.1? I am running 2.1 RC2 and I get some sql error about wrong table being requested for the links.
    Any help will be appreciated.
    Thanks,
    Peter

  25. Gravatar Commento di Adrian   (4 commenti)

    unfortunately this plugins doesn’t works in wordpress 2.1
    i love this plugins and i’m waiting a new release that works on wp 2.1
    sorry about my english brother! :wall:

  26. Gravatar Commento di Zelig   (410 commenti)

    I’m still running 2.0.7, so I’m not tested it yet…
    I’m sorry for the problem, as soon as I’ll upgrade my WP setup, I’ll try to fix it.

  27. Gravatar Commento di Michael   (1 commento)

    I’ve put your plugin on the list Plugins that don’t work at the WordPress Codex. Please remove it when you get it running in 2.1. Thanks.

  28. Gravatar Commento di Zelig   (410 commenti)

    Still no time to work on the plugin, but meanwhile it seems than someone did the job for me! Look here (if you can’t wait…).

  29. Gravatar Commento di Klaus   (3 commenti)

    Hi, any chance that I can change the background color and the color for the drop-down sign ?
    Klaus

  30. Gravatar Commento di Zelig   (410 commenti)

    Yes, Klaus. You can do it with CSS, as explained in this comment (it refers to another plugin, but it’s the same thing here)

  31. Gravatar Commento di Klaus   (3 commenti)

    Hi, the background color is changed. The only thing is, it seems to be impossible to change the buttom color ???

    rgds
    Klaus

  32. Gravatar Commento di Klaus   (3 commenti)

    Hi again, sorry I’m nearly a “dummy ” concerning CSS. Please have a look at www.m-etropolis.com My stylesheet looks like this: #sidebar select {
    background-color: #a9ac99;
    font-family: ‘Trebuchet MS’, ‘Bitstream Vera Sans’, Verdana, Arial, ‘Lucida Sans’, ‘Lucida Sans Unicode’, Helvetica, sans-serif;
    border: none;

    What I would like to chnage in addition is the bottom color background into white, the little blue arrow into black and the hover color into white. I’m using only 3 colors on my page, like: black, white and grey. Would be very kind of you, if you tell me how to do this.

    Klaus

  33. Gravatar Commento di saurabh   (1 commento)

    Dear Mr. Zelig,

    As per your instructions, i have successfully installed the “drop down links” in the plugins admin menu panel. After activating the plugin, i have no idea what to do next.

    I am relatively new to wordpress environment & would like a step by step description of how to go ahead, in order to implement the desired change in the blog (blogroll-links).

    I am using wordpress 2.1 currently. Kindly guide me, please.

    Thanks
    Saurabh

  34. Gravatar Commento di Zelig   (410 commenti)

    Rilasciata una nuova versione del plugin (1.2) compatibile con WP 2.1.
    Plugin’s new version released (1.2) compatible with Wordpress 2.1!

    @Klaus: I don’t think i’t possible to do what you want (or at least I don’t know how…)

    @Saurabh: first you have to download version 1.2 of the plugin. Unzip and activate it. Now go to Edit > File in your admin panel and open the “sidebar.php” file of your template, typing the name in the box at the bottom of the screen. Supposing you are using the default theme, you must write “/wp-content/themes/default/sidebar.php” (if you are using another template, change “default” with the correct folder name). Look at the code and find the row that calls the function get_links_list(). Delete that row and replace it with the zelig dropdown links code.

  35. Gravatar Commento di Adrian   (4 commenti)

    The latest version of this plugins is workingjust fine in wp 2.1!

    Thanks Brother! :clap:

  36. Gravatar Commento di Heathe   (2 commenti)

    Is there anyway to use this for external links? I’d like the same functionality but allow for external links as well. Any suggestions?

  37. Gravatar Commento di Zelig   (410 commenti)

    Heathe, this plugin IS for external links. What do you mean?

  38. Gravatar Commento di Heathe   (2 commenti)

    I thought this was only for posts within a category. I need aomething that will allow me to manually input links that are outside my own blog.

  39. Gravatar Commento di Zelig   (410 commenti)

    New to Wordpress, Heathe? :D
    You enter your external links as usual in your WP admin panel, then you can use this plugin to display them as a dropdown list instead of the default way.

  40. Gravatar Commento di selcuk   (1 commento)

    hi zelig ,ı used your plugin.very useful but when user change page.plugin is change side,ı put to code inside sidebar.php,please check out.ı couldnt anything.
    thanks anyway:D

  41. Gravatar Commento di Zelig   (410 commenti)

    It seems OK to me, Selcuk.

  42. Gravatar Commento di Adrian   (4 commenti)

    Corrado, I made a widget version of this plugins.

    Forgive me if I post this plugins without your permission. I Hope you like it too. :pray:

  43. Gravatar Commento di Zelig   (410 commenti)

    No problem, Adrian. :thumbup:

  44. Gravatar Commento di Carl   (1 commento)

    Great plugin, exactly what I was looking for. Just curious however, is there a way to display the link’s description?

  45. Gravatar Commento di Zelig   (410 commenti)

    No way, Carl, descriptions are ignored.

  46. Gravatar Commento di Bock The Robber   (3 commenti)

    Hi Zelig

    Thanks for your plugin. I installed it on my site (WP 2.1) and it works, but there’s a small bug. If you click a link and then navigate back to my site, the name of the link stays visible, instead of the category. Also, the link doesn’t work if you try to click it again. Is this the problem that was fixed at zazamataz.com?

    Also, if I make a list of previous posts that I want people to read, is there a dropdown that could show these posts?

  47. Gravatar Commento di Zelig   (410 commenti)

    Sorry Bock, no time to check and test at present. :(
    I’ll do ASAP and I’ll let you know.

  48. Gravatar Commento di Bock the Robber   (3 commenti)

    Grazie Zelig.

  49. Gravatar Commento di BG!   (1 commento)

    I’ve been trying to get this to work with the Redoable 1.2 theme and WP2.2 but it won’t work. Any ideas?

  50. Gravatar Commento di Zelig   (410 commenti)

    I don’t know that theme and I don’t use WP 2.2, so I’m sorry, BG… :-(

  51. Gravatar Commento di rightwingprof   (1 commento)

    Praise God, it works!

  52. Gravatar Commento di canarkadaş   (1 commento)

    Thanks..
    […] Açıklamalı 232 Wordpress eklentisi (Agu. 15, 2007 !!) (Wordpress plugin list),[…]

  53. Gravatar Commento di Opinion8ted   (1 commento)

    I like to dropdown links, except for one thing. Some of my blogroll include the target=”blank” instruction to bring up the page in a new tab/window. These links don’t behave this way in generated select code. Would it be possible to make it do so? (or is bringing up new pages such a rude idea that I shouldn’t do it at all).

    TIA

    Jim

  54. Gravatar Commento di Zelig   (410 commenti)

    Sorry Jim, but as said, “target” option is ignored by this plugin.

  55. Gravatar Commento di Jen Leheny   (1 commento)

    Great plugin - I would really like to have the links open in a new window/tab. You say above:
    @Shine: it is possible to modify the code to have the links opened in a new window, but I don’t recommend it because you can have some problems with that: for example, some “popup-stopper” could block it and Mozilla Firefox opens it in a new instance rather than in a new tab.

    If it is possible then please provide the code change to let us know how to get this happening. :)

    Jen

  56. Gravatar Commento di Riri Audiya   (1 commento)

    really nice plugin..

    cheers up! =)

  57. Gravatar Commento di baron   (2 commenti)

    hi there.com plugin but :

    Does anybody know if tis script is compatible with Wordpress 2.5?

    Thanks in advance for any help on this!

    turkbaron

  58. Gravatar Commento di baron   (2 commenti)

    hi. Thanks for plugin

    perfect…

  59. Gravatar Commento di ryan   (2 commenti)

    Thanks for this plugin - very nice. Like others, I’d really appreciate knowing how I can modify the code to open the links in a new window (despite the problems you mention).

    Baron - yes, it works in WP2.5. The (very) minor bug Bock the Robber mentions is still present tho.

  60. Gravatar Commento di Zelig   (410 commenti)

    I apologize for my late answer. I still have no time for programming and the only PC I can use is the one at office, but you know…

    So, to open links in a new window, if you really want, you can TRY this (and I say “try” because I’ve not tested it a lot, and i did it with version 1.1 only of the plugin…):

    Find the row with the code that says:


    echo '<p><select name="archive_chrono" onchange="window.location=(document.forms.linkform' . $cat['link_category'] . '.archive_chrono[document.forms.linkform' . $cat['link_category'] . '.archive_chrono.selectedIndex].value);"' . $boxlimit. "\n";

    (for version 1.1)

    or


    echo '<p><select name="archive_chrono" onchange="window.location=(document.forms.linkform' . $cat->cat_ID . '.archive_chrono[document.forms.linkform' . $cat->cat_ID . '.archive_chrono.selectedIndex].value);"' . $boxlimit. "\n";

    (for version 1.2)

    and replace it with this one (just copy & paste):


    echo '<p><select name="archive_chrono" onchange="ob=this.form.archive_chrono;window.open(ob.options[ob.selectedIndex].value)"' . $boxlimit . "\n";

    About the other bug you mention, I still don’t have a solution, sorry.

  61. Gravatar Commento di ryan   (2 commenti)

    Superb. That does the trick - very many thanks for the extra code to open the links in a new window. :thumbup:

  62. Gravatar Commento di Borski and Nai   (2 commenti)

    hi Zelig. Thanks for this cool plugin. I do have a minor bit of a problem. I just pasted the “” on the top of the sidebar script and it already showed in my sidebar. now the problem is that it exceeds the space of my sidebar to the left and i cant seem to make it stay inside. can you please take a look and see if there is anything you can help out with?

    i very much appreciate any help. thanks a lot and more power to you!

  63. Gravatar Commento di Borski and Nai   (2 commenti)

    oh btw, the site is www.borskinai.com
    its on the top of my first sidebar..

  64. Gravatar Commento di Zelig   (410 commenti)

    Borski, I looked - very quickly… - at the source code of your page and I’ve found that you open 2 times the DIV “sidebar”, one before my plugin and one after. Maybe the problem is there? :think:

  65. Gravatar Commento di PNOOZ   (1 commento)

    Very elegant solution to a link mess. I just installed with your “open in new window” snippet and it worked beautifully right out of the box. Thanks!

Scrivi un commento

:) :D :( :o 8O :? 8) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: :clap: :dance: :doh: :drool: :eh: :hand: :liar: :naughty: :pray: :shhh: :shifty: :sick: :silenced: :snooty: :think: :wall: :whistle: :love: :censored: :crazy: :food: :thumbup: :ciao: :cheers: :winky: :kiss: :rotfl: :ninja:

  

NOTE SUI COMMENTI:

  • Se non avete mai scritto nulla su questo blog, sappiate che il vostro primo commento dovrà essere approvato manualmente dall'amministratore e quindi non comparirà subito sul sito.
  • E' possibile usare dei tag HTML nel testo del commento, ma solamente quelli validi come XHTML "Strict" verranno accettati, quindi il risultato potrebbe anche essere un po' diverso dal previsto... nel dubbio, usate il testo semplice!
  • Questo blog supporta i "Gravatar": utilizzate lo stesso indirizzo e-mail con cui vi siete registrati e la vostra immagine comparirà automaticamente nel vostro commento. Se non avete ancora un gravatar, registratevi subito su www.gravatar.com!
  • La vostra e-mail, che comunque resterà sempre riservata, serve anche per il conteggio del totale dei vostri commenti e per inviarvi, se ne fate richiesta, gli avvisi di eventuali nuovi commenti.

Altri articoli nella stessa categoria

Ultimi articoli pubblicati, escluso questo, in "Computer"

Articolo precedente

Articolo successivo


Copyright © 1997-2008 Corrado "Zelig". Tutti i diritti riservati (vedi note legali)

NB: state visualizzando questo sito nella versione ottimizzata per dispositivi portatili (cellulari, palmari, ecc.) oppure con un browser "datato" che non consente di visualizzare correttamente i fogli di stile (CSS). I contenuti del sito sono comunque gli stessi e le differenze riguardano solamente l'aspetto estetico, che sarebbe molto più "piacevole" se visualizzato con un browser più recente!