Template:Navbox generic: differenze tra le versioni
Vai alla navigazione
Vai alla ricerca
m (User-controlled Bot: table syntax updated) |
(Annullata la modifica 13711 di AironBot (Discussione | contributi), Annullata la modifica 13678 di AironBot ([[User) |
||
Riga 1: | Riga 1: | ||
<table class="navbox collapsible {{{state|autocollapse}}} nowraplinks" style="margin:auto; width:100%; clear:both; border: 1px solid #aaa; padding: 2px; {{{style|}}}{{{bodystyle|}}}"> | |||
<tr><!-- | |||
<!-- | |||
---Titlebar--- | ---Titlebar--- | ||
--> | --> | ||
<th colspan="{{#if:{{{image|}}}|3|2}}" style="width:100%; background:#ccf; font-size:90%; {{{titlestyle|}}}"><!-- | |||
--><div style="float:left; width:6em; text-align:left; padding:0 10px;">{{#switch:{{{navbar|}}} |plain= |#default={{Tnavbar|{{{name<noinclude>|Navbox generic</noinclude>}}} |mini=1}}}}</div><span style="font-size:110%;">{{#if:{{{title|}}}|{{{title}}}|}}</span> | --><div style="float:left; width:6em; text-align:left; padding:0 10px;">{{#switch:{{{navbar|}}} |plain= |#default={{Tnavbar|{{{name<noinclude>|Navbox generic</noinclude>}}} |mini=1}}}}</div><span style="font-size:110%;">{{#if:{{{title|}}}|{{{title}}}|}}</span></th> | ||
<!-- | </tr><!-- | ||
---Above (optional)--- | ---Above (optional)--- | ||
-->{{#if:{{{above|}}} | | -->{{#if:{{{above|}}} |<tr><td style="background:#ddf; text-align:center; font-size:90%; {{{abovestyle|}}}" colspan="{{#if:{{{image|}}}|3|2}}">{{{above|}}}</td></tr>}}<!-- | ||
---Groups--- | ---Groups--- | ||
-->{{#if:{{{list1|}}}| | -->{{#if:{{{list1|}}}|<tr>{{#if:{{{group1|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group1}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group1|}}}|1|2}}">{{{list1}}}</td><!-- | |||
{{#if:{{{group1|}}}| | |||
}} | |||
-->{{#if:{{{image|}}}| | -->{{#if:{{{image|}}}|<td rowspan="{{#expr: {{#if:{{{list1|}}}|1|0}} +{{#if:{{{list2|}}}|1|0}} +{{#if:{{{list3|}}}|1|0}} +{{#if:{{{list4|}}}|1|0}} +{{#if:{{{list5|}}}|1|0}} +{{#if:{{{list6|}}}|1|0}} +{{#if:{{{list7|}}}|1|0}} +{{#if:{{{list8|}}}|1|0}} +{{#if:{{{list9|}}}|1|0}} +{{#if:{{{list10|}}}|1|0}} +{{#if:{{{list11|}}}|1|0}} +{{#if:{{{list12|}}}|1|0}} +{{#if:{{{list13|}}}|1|0}} +{{#if:{{{list14|}}}|1|0}} +{{#if:{{{list15|}}}|1|0}} +{{#if:{{{list16|}}}|1|0}} +{{#if:{{{list17|}}}|1|0}} +{{#if:{{{list18|}}}|1|0}} +{{#if:{{{list19|}}}|1|0}} +{{#if:{{{list20|}}}|1|0}}}}" | ||
style="vertical-align:middle; padding-left:7px; width:0%; {{{imagestyle|}}}">{{{image}}}</td>}}</tr>}}<!-- | |||
style="vertical-align:middle; padding-left:7px; width:0%; {{{imagestyle|}}}" | |||
-->{{#if:{{{list2|}}}| | -->{{#if:{{{list2|}}}|<tr>{{#if:{{{group2|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group2}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group2|}}}|1|2}}">{{{list2}}}</td></tr>}}<!-- | |||
{{#if:{{{group2|}}}| | |||
}} | |||
-->{{#if:{{{list3|}}}| | -->{{#if:{{{list3|}}}|<tr>{{#if:{{{group3|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group3}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group3|}}}|1|2}}">{{{list3}}}</td></tr>}}<!-- | |||
{{#if:{{{group3|}}}| | |||
}} | |||
-->{{#if:{{{list4|}}}| | -->{{#if:{{{list4|}}}|<tr>{{#if:{{{group4|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group4}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group4|}}}|1|2}}">{{{list4}}}</td></tr>}}<!-- | |||
{{#if:{{{group4|}}}| | |||
}} | |||
-->{{#if:{{{list5|}}}| | -->{{#if:{{{list5|}}}|<tr>{{#if:{{{group5|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group5}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group5|}}}|1|2}}">{{{list5}}}</td></tr>}}<!-- | |||
{{#if:{{{group5|}}}| | |||
}} | |||
-->{{#if:{{{list6|}}}| | -->{{#if:{{{list6|}}}|<tr>{{#if:{{{group6|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group6}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group6|}}}|1|2}}">{{{list6}}}</td></tr>}}<!-- | |||
{{#if:{{{group6|}}}| | |||
}} | |||
-->{{#if:{{{list7|}}}| | -->{{#if:{{{list7|}}}|<tr>{{#if:{{{group7|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group7}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group7|}}}|1|2}}">{{{list7}}}</td></tr>}}<!-- | |||
{{#if:{{{group7|}}}| | |||
}} | |||
-->{{#if:{{{list8|}}}| | -->{{#if:{{{list8|}}}|<tr>{{#if:{{{group8|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group8}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group8|}}}|1|2}}">{{{list8}}}</td></tr>}}<!-- | |||
{{#if:{{{group8|}}}| | |||
}} | |||
-->{{#if:{{{list9|}}}| | -->{{#if:{{{list9|}}}|<tr>{{#if:{{{group9|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group9}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group9|}}}|1|2}}">{{{list9}}}</td></tr>}}<!-- | |||
{{#if:{{{group9|}}}| | |||
}} | |||
-->{{#if:{{{list10|}}}| | -->{{#if:{{{list10|}}}|<tr>{{#if:{{{group10|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group10}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group10|}}}|1|2}}">{{{list10}}}</td></tr>}}<!-- | |||
{{#if:{{{group10|}}}| | |||
}} | |||
-->{{#if:{{{list11|}}}| | -->{{#if:{{{list11|}}}|<tr>{{#if:{{{group11|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group11}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group11|}}}|1|2}}">{{{list11}}}</td></tr>}}<!-- | |||
{{#if:{{{group11|}}}| | |||
}} | |||
-->{{#if:{{{list12|}}}| | -->{{#if:{{{list12|}}}|<tr>{{#if:{{{group12|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group12}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group12|}}}|1|2}}">{{{list12}}}</td></tr>}}<!-- | |||
{{#if:{{{group12|}}}| | |||
}} | |||
-->{{#if:{{{list13|}}}| | -->{{#if:{{{list13|}}}|<tr>{{#if:{{{group13|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group13}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group13|}}}|1|2}}">{{{list13}}}</td></tr>}}<!-- | |||
{{#if:{{{group13|}}}| | |||
}} | |||
-->{{#if:{{{list14|}}}| | -->{{#if:{{{list14|}}}|<tr>{{#if:{{{group14|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group14}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group14|}}}|1|2}}">{{{list14}}}</td></tr>}}<!-- | |||
{{#if:{{{group14|}}}| | |||
}} | |||
-->{{#if:{{{list15|}}}| | -->{{#if:{{{list15|}}}|<tr>{{#if:{{{group15|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group15}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group15|}}}|1|2}}">{{{list15}}}</td></tr>}}<!-- | |||
{{#if:{{{group15|}}}| | |||
}} | |||
-->{{#if:{{{list16|}}}| | -->{{#if:{{{list16|}}}|<tr>{{#if:{{{group16|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group16}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{evenstyle|}}}" colspan="{{#if:{{{group16|}}}|1|2}}">{{{list16}}}</td></tr>}}<!-- | |||
{{#if:{{{group16|}}}| | |||
}} | |||
-->{{#if:{{{list17|}}}| | -->{{#if:{{{list17|}}}|<tr>{{#if:{{{group17|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group17}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group17|}}}|1|2}}">{{{list17}}}</td></tr>}}<!-- | |||
{{#if:{{{group17|}}}| | |||
}} | |||
-->{{#if:{{{list18|}}}| | -->{{#if:{{{list18|}}}|<tr>{{#if:{{{group18|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group18}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group18|}}}|1|2}}">{{{list18}}}</td></tr>}}<!-- | |||
{{#if:{{{group18|}}}| | |||
}} | |||
-->{{#if:{{{list19|}}}| | -->{{#if:{{{list19|}}}|<tr>{{#if:{{{group19|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group19}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group19|}}}|1|2}}">{{{list19}}}</td></tr>}}<!-- | |||
{{#if:{{{group19|}}}| | |||
}} | |||
-->{{#if:{{{list20|}}}| | -->{{#if:{{{list20|}}}|<tr>{{#if:{{{group20|}}}|<th style="background:#ddf; white-space:nowrap; padding:0 10px; font-size:90%; {{{groupstyle|}}}">{{{group20}}}</th>}} | ||
<td style="width:100%; font-size:90%; text-align:center;background:#f7f7f7; {{{liststyle|}}}{{{oddstyle|}}}" colspan="{{#if:{{{group20|}}}|1|2}}">{{{list20}}}</td></tr>}}<!-- | |||
{{#if:{{{group20|}}}| | |||
}} | |||
---Below (optional)--- | ---Below (optional)--- | ||
-->{{#if:{{{below|}}}| | -->{{#if:{{{below|}}}|<tr><td style="background:#ddf; text-align:center; font-size:90%; {{{belowstyle|}}}" colspan="{{#if:{{{image|}}}|3|2}}">{{{below|}}}</td></tr>}}<!-- | ||
--> | --></table><noinclude> | ||
{{man}} | {{man}} | ||
[[Categoria:Template di navigazione|Template di navigazione]] | [[Categoria:Template di navigazione|Template di navigazione]] | ||
</noinclude> | </noinclude> |
Versione delle 14:31, 26 gen 2009
[pagina] [modifica] [cronologia] [pulisci]
Documentazione
Questo template consente di visualizzare un template di navigazione in maniera relativamente semplice e rapida.
Sintassi semplice
{{Navbox generic |name = {{subst:PAGENAME}} |state = |title = |group1 = |list1 = |group2 = |list2 = ... |group20 = |list20 = }}
Sintassi completa
{{Navbox generic |name = {{subst:PAGENAME}} |navbar = |state = |titlestyle = |title = |image = |bodystyle = <!-- (o "style =" se non sono stati utilizzati altri parametri di stile --> |groupstyle = |liststyle = |oddstyle = |evenstyle = |abovestyle = |above = |group1 = |list1 = |group2 = |list2 = ... |group20 = |list20 = |belowstyle = |below = }}
Parametri
- name
- Il nome del template che si vuole creare, necessario perché funzionino i link "v · d · m" ("vedi · discuti · modifica") in tutte le pagine dove il template è usato. Con
{{subst:PAGENAME}}
il parametro si compila automaticamente.
- title
- È il testo che appare al centro della barra del titolo del template, formato da una riga sola.
- listn
- Questi parametri riempiono il corpo del template, che usualmente sarà una lista di wikilink. Ogni listn è preceduto dal corrispondente parametro groupn, se fornito. La lista di wikilink sarà separata dal template {{dot}} (uso), con lateralmente uno spazio.
Opzionali
Celle
- groupn
- Se specificati, il testo appare in una cella alla sinistra del relativo listn. Se non specificati, listn occupa l'intera larghezza della tabella.
- image
- Un'immagine viene visualizzata in una cella al di sotto del titolo e alla destra della parte di tabella che comprende i groups/lists. Affinché l'immagine sia visualizzata correttamente, il parametro list1 deve essere specificato.
- above
- Una cella larga come tutta la tabella verrà visualizzata tra la barra del titolo e il primo group/list, in pratica sopra la parte di tabella occupata da group, list e image. In un template senza immagine, above svolge la stessa funzione del parametro list1 senza il relativo parametro group1.
- below
- Una cella larga come tutta la tabella verrà visualizzata al di sotto della parte di tabella occupata da group, list e image. In un template senza immagine, below svolge la stessa funzione del parametro listn finale.
Stili
- titlestyle
- Gli stili CSS da applicare al parametro title, usualmente per cambiare il colore di sfondo:
titlestyle = background:#nnnnnn;
titlestyle = background:nome del colore;
- bodystyle o style
- Specifica gli stili CSS] da applicare al corpo del template. Il nome breve style può essere usato quando nessun altro parametro di stile è stato specificato. Questa opzione dovrebbe essere usata con cautela perché potrebbe causare problemi di visualizzazione. Esempi:
background:#nnnnnn;
width:N [em/%/px];
float:[left/right/none];
clear:[right/left/both/none];
- groupstyle
- Stili CSS da applicare alle celle groupN. Esempi:
background:#nnnnnn;
text-align:[left/center/right];
vertical-align:[top/middle/bottom];
white-space:nowrap;
- liststyle
- Stili CSS da applicare a tutte le liste di link.
- oddstyle per le liste dispari
- evenstyle per le liste pari
- Stili CSS da applicare a singole celle di liste dispari (list1, list3 ecc.) o pari (list2, list4 ecc). Di default, viene applicato un colore di sfondo alternato bianco/grigio tra le varie liste per rendere più facile la consultazione.
- abovestyle
- belowstyle
- Stili CSS da applicare a celle opzionali al di sopra o al di sotto della tabella (vedi parametri above e below). Tipicamente si utilizza per cambiare allineamento del testo o colore di sfondo:
background:#nnnnnn;
text-align:[left/center/right];
Altri
- state
- Il default è
autocollapse
. Un navbox conautocollapse
inizierà chiuso solo se ci sono due o più template nella stessa pagina che usano il class collapsible. Altrimenti, al momento dell'apertura della pagina il navbox verrà visualizzato aperto. - Se si inserisce
collapsed
, il navbox verrà visualizzato chiuso.
- navbar
- Di default
Tnavbar
. Se si inserisceplain
, i link "v · d · m" sulla sinistra della barra del titolo non verranno visualizzati.
Se hai qualche domanda su questo template, puoi porre una domanda al pronto soccorso. |