Articolo multilingue / Multilanguage post
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”.
Tutti i plugin per Wordpress di Zelig li trovi qui!
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'); ?>
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!
Questo articolo è stato scritto da Zelig il
5 Agosto 2006 alle ore 20:32 ed è catalogato come "Computer".
Puoi seguire i commenti a questo articolo mediante il feed RSS 2.0.
Puoi anche scrivere un commento o inviare un trackback dal tuo sito.
6 Settembre 2006 - ore 08:34
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?
6 Settembre 2006 - ore 08:56
Another question
How can I delete the old links lists from the sidebar?
6 Settembre 2006 - ore 20:57
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.
17 Settembre 2006 - ore 10:32
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!
17 Settembre 2006 - ore 20:00
Thank you, Jayne!
27 Settembre 2006 - ore 20:48
I placed it on my sie and keep getting an error. I would appreciate if you could have lok. Thanks
28 Settembre 2006 - ore 21:14
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!
30 Settembre 2006 - ore 06:12
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
3 Ottobre 2006 - ore 17:52
@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 Ottobre 2006 - ore 09:38
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
10 Ottobre 2006 - ore 20:53
Io sono un maniaco della validazione!
11 Ottobre 2006 - ore 16:55
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
21 Ottobre 2006 - ore 01:23
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.
21 Ottobre 2006 - ore 17:11
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.
14 Dicembre 2006 - ore 23:42
Zelig -
I LOVE this plugin!
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
20 Dicembre 2006 - ore 14:20
@Elyse: no way at present, sorry. Maybe next version…
2 Gennaio 2007 - ore 23:40
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
4 Gennaio 2007 - ore 14:47
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.
12 Gennaio 2007 - ore 09:28
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.
13 Gennaio 2007 - ore 05:09
this plugins is great!
i use it for my blog and it’s working just like what i want
thanks brother!
17 Gennaio 2007 - ore 18:57
Rilasciata una nuova versione del plugin (1.1)
Plugin’s new version released (1.1)
This should help Elise, Elena and Dave, I hope!
18 Gennaio 2007 - ore 07:02
Bravo!! With the combination of include and exclude, I can control what goes where and the order. This is perfect. Thank you again.
23 Gennaio 2007 - ore 05:24
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
23 Gennaio 2007 - ore 06:27
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!
23 Gennaio 2007 - ore 09:24
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 Gennaio 2007 - ore 23:11
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.
9 Febbraio 2007 - ore 19:36
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…).
14 Febbraio 2007 - ore 22:08
Hi, any chance that I can change the background color and the color for the drop-down sign ?
Klaus
15 Febbraio 2007 - ore 17:40
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)
15 Febbraio 2007 - ore 17:57
Hi, the background color is changed. The only thing is, it seems to be impossible to change the buttom color ???
rgds
Klaus
15 Febbraio 2007 - ore 18:30
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
16 Febbraio 2007 - ore 11:12
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
16 Febbraio 2007 - ore 19:48
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.
17 Febbraio 2007 - ore 09:51
The latest version of this plugins is workingjust fine in wp 2.1!
Thanks Brother!
18 Febbraio 2007 - ore 17:44
Is there anyway to use this for external links? I’d like the same functionality but allow for external links as well. Any suggestions?
19 Febbraio 2007 - ore 09:42
Heathe, this plugin IS for external links. What do you mean?
19 Febbraio 2007 - ore 14:53
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.
20 Febbraio 2007 - ore 09:10
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.
9 Marzo 2007 - ore 21:32
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
10 Marzo 2007 - ore 09:23
It seems OK to me, Selcuk.
1 Maggio 2007 - ore 06:24
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.
1 Maggio 2007 - ore 14:58
No problem, Adrian.
2 Maggio 2007 - ore 01:46
Great plugin, exactly what I was looking for. Just curious however, is there a way to display the link’s description?
2 Maggio 2007 - ore 08:18
No way, Carl, descriptions are ignored.
9 Maggio 2007 - ore 12:20
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?
12 Maggio 2007 - ore 12:32
Sorry Bock, no time to check and test at present.
I’ll do ASAP and I’ll let you know.
15 Maggio 2007 - ore 22:11
Grazie Zelig.
10 Settembre 2007 - ore 17:48
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?
12 Settembre 2007 - ore 09:31
I don’t know that theme and I don’t use WP 2.2, so I’m sorry, BG…
15 Settembre 2007 - ore 19:51
Praise God, it works!
23 Settembre 2007 - ore 18:23
Thanks..
[…] Açıklamalı 232 Wordpress eklentisi (Agu. 15, 2007 !!) (Wordpress plugin list),[…]
8 Dicembre 2007 - ore 04:35
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
9 Dicembre 2007 - ore 15:10
Sorry Jim, but as said, “target” option is ignored by this plugin.
7 Febbraio 2008 - ore 23:26
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
25 Marzo 2008 - ore 14:36
really nice plugin..
cheers up! =)
9 Aprile 2008 - ore 03:19
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
29 Aprile 2008 - ore 01:12
hi. Thanks for plugin
perfect…
3 Maggio 2008 - ore 18:34
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.
7 Maggio 2008 - ore 11:07
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.
10 Maggio 2008 - ore 00:29
Superb. That does the trick - very many thanks for the extra code to open the links in a new window.
21 Maggio 2008 - ore 04:46
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!
21 Maggio 2008 - ore 04:47
oh btw, the site is www.borskinai.com
its on the top of my first sidebar..
21 Maggio 2008 - ore 08:29
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?
28 Maggio 2008 - ore 01:07
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!
17 Agosto 2008 - ore 05:48
thank you bro