Visto il discreto successo del plugin Zelig dropdown cats, eccone un altro della stessa serie, che tra l’altro risponde ad alcune richieste dei miei lettori.
Questo plugin mostra i link nella sidebar come una semplice lista di selezione a discesa. Qualora si utilizzassero diverse categorie di link, verranno visualizzate altrettante liste.
Il plugin dovrebbe sostituire la funzione standard get_links_list() e potrà essere sicuramente utile a chi ha degli elenchi di link molto lunghi ma allo stesso tempo non vuole ingombrare troppo la barra laterale del blog.
ISTRUZIONI:
- Scaricare il file zip contenente il plugin. Esistono due versioni, entrambe con le stesse caratteristiche, da scegliere a seconda della versione di WordPress che state usando:
Zelig Dropdown Links 1.2 – Per WP 2.1 (e seguenti, spero…);
Zelig Dropdown Links 1.1 – Per versioni di WP precedenti.
- Estrarre il file zelig-dropdown-links.php nella cartella dei plugin della vostra installazione di WordPress (wp-content/plugins).
- Entrare nel pannello di amministrazione di WordPress, aprire la pagina dei Plugin e attivare il plugin stesso.
- Inserire il seguente codice HTML da qualche parte in una pagina del vostro template, fuori dal loop (il suo posto naturale è nella sidebar):
<?php zelig_dropdown_links(); ?>
La funzione zelig_dropdown_links() ha alcuni parametri che possono essere specificati (prestare attenzione al fatto che la sintassi dei parametri è cambiata rispetto alla versione 1.0):
Parametro |
Valori |
Descrizione |
Default |
boxwidth |
numero |
larghezza della list box in pixel. Se non specificata o se impostata a zero, la lista assumerà la larghezza del nome più lungo dei link che contiene. Se invece viene impostato un valore, i nomi eventualmente più lunghi potrebbero essere troncati in quel punto, a seconda del browser utilizzato (IE6…) |
0 |
exclude |
numero o elenco di numeri separati da virgole |
categoria di link o elenco di categorie di link (numeri ID) da non visualizzare. Se non specificato o se impostato a zero, tutte le categorie di link verranno visualizzate. |
0 |
include |
numero o elenco di numeri separati da virgole |
categoria di link o elenco di categorie di link (numeri ID) da visualizzare. Se non specificato o se impostato a zero, tutte le categorie di link verranno visualizzate. |
0 |
title |
0
1 |
se impostato a zero, non viene mostrato il nome della categoria di link come prima riga della lista (quella visibile quando è chiusa). |
1 |
ESEMPI:
<?php zelig_dropdown_links('boxwidth=120'); ?>
Ogni lista sarà larga esattamente 120 pixel.
<?php zelig_dropdown_links('boxwidth=120&exclude=1'); ?>
Ogni lista sarà larga esattamente 120 pixel e non verrà mostrata la categoria di link con ID 1.
<?php zelig_dropdown_links('boxwidth=120&exclude=1,2,3'); ?>
Ogni lista sarà larga 120 pixel e non verranno mostrate le categorie di link con ID 1, 2 e 3.
<?php zelig_dropdown_links('include=1&title=0'); ?>
Verrà mostrata solamente la categoria di link con ID 1 e senza il nome della categoria come “titolo” della lista.
Questo plugin, anche per le caratteristiche stesse del tipo di visualizzazione, non tiene conto di molti elementi impostabili nei link di WordPress, come immagine, descrizione, punteggio, target e rel. Vengono utilizzati solo l’URI, il nome, il tipo di ordinamento, la visibilità e il limite per ogni categoria.
NOTE:
E’ possibile usare diverse istanze della funzione nella stessa pagina (purché non si visualizzino gli stessi link).
Il codice restituito dalla funzione è valido XHTML Strict.
Plugin testato solamente con WordPress da 2.0.4 a 2.1.
AGGIORNAMENTI:
- Versione 1.2 (16 febbraio 2007): compatibile con WordPress 2.1.
- Versione 1.1 (17 gennaio 2007): aggiunte le opzioni “include”, “exclude” e “title”.
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:
- 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.
- Extract the zelig-dropdown-links.php file into the plugins directory in your WordPress installation (wp-content/plugins).
- Log in to WordPress administration. Go to the Plugins page and Activate this plugin.
- 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'); ?>
Displays 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.
Hi,
I installed your lovely plugin “dropdown”
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?
Another question
How can I delete the old links lists from the sidebar?
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.
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!
Thank you, Jayne!
I placed it on my sie and keep getting an error. I would appreciate if you could have lok. Thanks
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!
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
@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!
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
Io sono un maniaco della validazione!
Anch’io
ma passando al serio ‘ veramente positivo farlo.
Solide basi e accessibilità molto piu’ facile per tutti.
Per non parlare della banda risparmiata
ciao:whistle:
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.
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.
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:
@Elyse: no way at present, sorry. Maybe next version…
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
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.
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.
this plugins is great!
i use it for my blog and it’s working just like what i want
thanks brother!
Rilasciata una nuova versione del plugin (1.1)
Plugin’s new version released (1.1)
This should help Elise, Elena and Dave, I hope!
Bravo!! With the combination of include and exclude, I can control what goes where and the order. This is perfect. Thank you again.:cheers:
Pingback: Soporte-Wordpress
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
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!
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.
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.
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…).
Hi, any chance that I can change the background color and the color for the drop-down sign ?
Klaus
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)
Hi, the background color is changed. The only thing is, it seems to be impossible to change the buttom color ???
rgds
Klaus
Hi again, sorry I’m nearly a “dummy ” concerning CSS. Please have a look at http://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
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
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.
The latest version of this plugins is workingjust fine in wp 2.1!
Thanks Brother!
Is there anyway to use this for external links? I’d like the same functionality but allow for external links as well. Any suggestions?
Heathe, this plugin IS for external links. What do you mean?
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.
New to WordPress, Heathe?
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.
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
It seems OK to me, Selcuk.
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.
No problem, Adrian.
Great plugin, exactly what I was looking for. Just curious however, is there a way to display the link’s description?
No way, Carl, descriptions are ignored.
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?
Sorry Bock, no time to check and test at present.
I’ll do ASAP and I’ll let you know.
Grazie Zelig.
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?
I don’t know that theme and I don’t use WP 2.2, so I’m sorry, BG…
Praise God, it works!
Thanks..
[…] Açıklamalı 232 WordPress eklentisi (Agu. 15, 2007 !!) (WordPress plugin list),[…]
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
Sorry Jim, but as said, “target” option is ignored by this plugin.
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
really nice plugin..
cheers up! =)
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
hi. Thanks for plugin
perfect…
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.
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:
or
(for version 1.2)
and replace it with this one (just copy & paste):
About the other bug you mention, I still don’t have a solution, sorry.
Superb. That does the trick – very many thanks for the extra code to open the links in a new window.
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!
oh btw, the site is http://www.borskinai.com
its on the top of my first sidebar..
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?
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!
thank you bro
Pingback: Google, SEO ve Webmaster Blog
Would it be possible for you to offer an update to this GREAT plugin which uses the WordPress “target” option? I have all my links set to “target=’_blank'” in the WordPress Admin UI, but they don’t open a new tab or window.
And just so you know: the behavior of a browser with a ‘_blank’ target is usually controlled in preferences. FF can be set to open in a new tab or in a new window (instance).
D’OH! Just saw the hack code above. And… IT WORKS on WordPress 2.7.1! Congrats on “forward-compatible” code; and thanks!
Pingback: 200 WordPress Plugin List, 200 Wordpress Eklentisi | Hasan Yordana
it is supper but I like link to be open new windows
in this plugin links do not open in new windows
what is solution?
thanks
This plugin is not supported anymore, but you can try the solution posted (years ago…) some comments above.
Pingback: 147 Adet WordPress Eklentisi Turkce - gonulsohbet