Zelig Planet

Un amico è uno che sa tutto di te e nonostante questo gli piaci. (Ebert Hubbard)

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

Archivio blog - giorno 5 Agosto 2006

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!


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!