Changes

Jump to navigation Jump to search
m
no edit summary
{{documentation subpage}}
<!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata|]]). -->
{{for|vertically-aligned navigation|Template:Sidebar}}
{{#ifeq:{{FULLPAGENAME}}|Template:Navbox|{{high-risk| approximately 2600000 }}}}<includeonly>
: <code>name</code> – the name of the template.
: <code>title</code> – text in the title bar, such as: <nowiki>[[Wikipedia:Widget stuff|]]</nowiki>.
: <code>listclass</code> – a CSS class for the list cells, usually <code>hlist</code> for horizontal lists. Alternatively, use bodyclass for the whole box.
: <code>state</code> – controls when a navbox is expanded or collapsed.
:: <code><nowiki>| state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}</nowiki></code>
:* The {{tag|includeonly|o}}<code>|</code> will make the template expanded when viewing the template page by itself.
::* Example 1: {{tl|Peso}} with ''autocollapse'' as the default initial state. [[Wikipedia:Catalan peseta|Catalan peseta]] transcludes it and has only one navbox; thus, the peso navbox shows. [[Wikipedia:Chilean peso|Chilean peso]] has more than two navboxes; thus, the peso navbox collapses.
::* Example 2: {{tl|Historical currencies of Hungary}} with ''expanded'' as the default initial state, as such:
:::<code><nowiki>| state = {{{state<includeonly>|expanded</includeonly>}}}</nowiki></code>
:; ''list<sub>n</sub>''*
:: (i.e. ''list1'', ''list2'', etc.) The body of the template, usually a list of links. Format is inline, although the text can be entered on separate lines if the entire list is enclosed within <code><nowiki><div> </div></nowiki></code>. At least one ''list'' parameter is required; each additional ''list'' is displayed in a separate row of the table. Each ''list<sub>n</sub>'' may be preceded by a corresponding ''group<sub>n</sub>'' parameter, if provided (see below).
::Entries should be separated using a [[Wikipedia:newline|newline]] and an [[Wikipedia:asterisk|asterisk]] (*). If instead two asterisks are used, it provides [[Wikipedia:Nesting (computing)|nesting]] within the previous entry by enclosing the entry with brackets. Increasing the number of asterisks used increases the number of brackets around entries.
:; ''image''*
:: An image to be displayed in a cell below the title and to the right of the body (the groups/lists). For the image to display properly, the ''list1'' parameter must be specified. The ''image'' parameter accepts standard wikicode for displaying an image, ''e.g.'':
::: <code><nowiki>[[File:</nowiki><var>XX</var><nowiki>.jpg|80px|link=|alt=]]</nowiki></code>
::: nb: including "|right" will produce the usual left margin to provide separation from the list items and [[Wikipedia:Zebra striping (computer graphics)|zebra striping]].
:; ''imageleft''*
:: An image to be displayed in a cell below the title and to the left of the body (lists). For the image to display properly, the ''list1'' parameter must be specified and no groups can be specified. It accepts the same sort of parameter that ''image'' accepts.
:; ''bodystyle''*
:: Specifies [[Wikipedia:Cascading Style Sheets|CSS]] styles to apply to the template body. This option should be used sparingly as it can lead to visual inconsistencies. Examples:
::: <code>bodystyle = background: #''nnnnnn'';</code>
::: <code>bodystyle = width: ''N''&nbsp;[em/%/px or width: auto];</code>
::: <code>basestyle = background: lightskyblue;</code>
:; ''titlestyle''*
:: [[Wikipedia:Cascading Style Sheets|CSS]] styles to apply to ''title'', most often the titlebar's background color:
::: <code>titlestyle = background: ''#nnnnnn'';</code>
::: <code>titlestyle = background: ''name'';</code>
:: This parameter is inserted into the "class" attribute for the navbox's title caption.
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a navbox as containing [[Wikipedia:hCard|hCard]] information about a person, for example, add the following parameter:
<pre>
<pre><nowiki>
| title = The books of <span class="fn">[[Wikipedia:Iain Banks|]]</span>
</nowiki></pre>
...and so forth.
See [[Wikipedia:WikiProject Microformats|WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[Wikipedia:microformat|microformat]] for more information on microformats in general.
== Layout of table ==
{{Navbox
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|]]
| listclass = hlist
| group1 = Centre
| list1 =
* [[Wikipedia:Cyberjaya|]]
| group2 = Area
| list2 =
* [[Wikipedia:Klang Valley|]]
| group3 = Major landmarks
| list3 =
* [[Wikipedia:Petronas Twin Towers|]] * [[Wikipedia:Kuala Lumpur Tower|]] * [[Wikipedia:Kuala Lumpur Sentral|]] * [[Wikipedia:Technology Park Malaysia|]] * [[Wikipedia:Putrajaya|]] * [[Wikipedia:Cyberjaya|]] * [[Wikipedia:Kuala Lumpur International Airport|]]
| group4 = Infrastructure
| list4 =
* [[Wikipedia:Express Rail Link|]] * [[Wikipedia:KL-KLIA Dedicated Expressway|]]
| group5 = Prime applications
| list5 =
* [[Wikipedia:E-Government|]] * [[Wikipedia:MyKad|]]
}}
</source>
| name = Navbox/doc
| state = uncollapsed
| title = [[Wikipedia:MSC Malaysia|MSC Malaysia]]
| listclass = hlist
| group1 = Centre
| list1 =
* [[Wikipedia:Cyberjaya|Cyberjaya]]
| group2 = Area
| list2 =
* [[Wikipedia:Klang Valley|Klang Valley]]
| group3 = Major landmarks
| list3 =
* [[Wikipedia:Petronas Twin Towers|Petronas Twin Towers]]* [[Wikipedia:Kuala Lumpur Tower|Kuala Lumpur Tower]]* [[Wikipedia:Kuala Lumpur Sentral|Kuala Lumpur Sentral]]* [[Wikipedia:Technology Park Malaysia|Technology Park Malaysia]]* [[Wikipedia:Putrajaya|Putrajaya]]* [[Wikipedia:Cyberjaya|Cyberjaya]]* [[Wikipedia:Kuala Lumpur International Airport|Kuala Lumpur International Airport]]
| group4 = Infrastructure
| list4 =
* [[Wikipedia:Express Rail Link|Express Rail Link]]* [[Wikipedia:KL-KLIA Dedicated Expressway|KL-KLIA Dedicated Expressway]]
| group5 = Prime applications
| list5 =
* [[Wikipedia:E-Government|E-Government]]* [[Wikipedia:MyKad|MyKad]]
}}
{{Navbox
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|]]
| listclass = hlist
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| list1 =
* [[Wikipedia:Petronas Twin Towers|]] * [[Wikipedia:Kuala Lumpur Tower|]] * [[Wikipedia:Kuala Lumpur Sentral|]] * [[Wikipedia:Technology Park Malaysia|]] * [[Wikipedia:Putrajaya|]] * [[Wikipedia:Cyberjaya|]] * [[Wikipedia:Kuala Lumpur International Airport|]]
}}
</source>
{{{{PAGENAMETDOC}}
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|MSC Malaysia]]
| listclass = hlist
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| list1 =
* [[Wikipedia:Petronas Twin Towers|Petronas Twin Towers]]* [[Wikipedia:Kuala Lumpur Tower|Kuala Lumpur Tower]]* [[Wikipedia:Kuala Lumpur Sentral|Kuala Lumpur Sentral]]* [[Wikipedia:Technology Park Malaysia|Technology Park Malaysia]]* [[Wikipedia:Putrajaya|Putrajaya]]* [[Wikipedia:Cyberjaya|Cyberjaya]]* [[Wikipedia:Kuala Lumpur International Airport|Kuala Lumpur International Airport]]
}}
{{Navbox
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|]]
| listclass = hlist
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| list1 =
* [[Wikipedia:Petronas Twin Towers|]] * [[Wikipedia:Kuala Lumpur Tower|]] * [[Wikipedia:Kuala Lumpur Sentral|]]
| list2 =
* [[Wikipedia:Express Rail Link|]] * [[Wikipedia:KL-KLIA Dedicated Expressway|]]
| list3 =
* [[Wikipedia:E-Government|]] * [[Wikipedia:MyKad|]]
| list4 =
* [[Wikipedia:Klang Valley|]]
}}
</source>
{{{{PAGENAMETDOC}}
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|MSC Malaysia]]
| listclass = hlist
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| imageleft = [[File:Flag of Malaysia.svg|80px]]
| list1 =
* [[Wikipedia:Petronas Twin Towers|Petronas Twin Towers]]* [[Wikipedia:Kuala Lumpur Tower|Kuala Lumpur Tower]]* [[Wikipedia:Kuala Lumpur Sentral|Kuala Lumpur Sentral]]
| list2 =
* [[Wikipedia:Express Rail Link|Express Rail Link]]* [[Wikipedia:KL-KLIA Dedicated Expressway|KL-KLIA Dedicated Expressway]]
| list3 =
* [[Wikipedia:E-Government|E-Government]]* [[Wikipedia:MyKad|MyKad]]
| list4 =
* [[Wikipedia:Klang Valley|Klang Valley]]
}}
{{Navbox
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|]]
| listclass = hlist
| above = Above text goes here
| group1 = Centre
| list1 =
* [[Wikipedia:Cyberjaya|]]
| group2 = Area
| list2 =
* [[Wikipedia:Klang Valley|]]
| group3 = Major landmarks
| list3 =
* [[Wikipedia:Petronas Twin Towers|]] * [[Wikipedia:Kuala Lumpur Tower|]] * [[Wikipedia:Kuala Lumpur Sentral|]] * [[Wikipedia:Technology Park Malaysia|]] * [[Wikipedia:Putrajaya|]] * [[Wikipedia:Cyberjaya|]]
| group4 = Infrastructure
| list4 =
* [[Wikipedia:Express Rail Link|]] * [[Wikipedia:KL-KLIA Dedicated Expressway|]]
| group5 = Prime applications
| list5 =
* [[Wikipedia:E-Government|]] * [[Wikipedia:MyKad|]]
| below = Below text goes here
{{{{PAGENAMETDOC}}
| name = Navbox/doc
| title = [[Wikipedia:MSC Malaysia|MSC Malaysia]]
| listclass = hlist
| above = Above text goes here
| group1 = Centre
| list1 =
* [[Wikipedia:Cyberjaya|Cyberjaya]]
| group2 = Area
| list2 =
* [[Wikipedia:Klang Valley|Klang Valley]]
| group3 = Major landmarks
| list3 =
* [[Wikipedia:Petronas Twin Towers|Petronas Twin Towers]]* [[Wikipedia:Kuala Lumpur Tower|Kuala Lumpur Tower]]* [[Wikipedia:Kuala Lumpur Sentral|Kuala Lumpur Sentral]]* [[Wikipedia:Technology Park Malaysia|Technology Park Malaysia]]* [[Wikipedia:Putrajaya|Putrajaya]]* [[Wikipedia:Cyberjaya|Cyberjaya]]
| group4 = Infrastructure
| list4 =
* [[Wikipedia:Express Rail Link|Express Rail Link]]* [[Wikipedia:KL-KLIA Dedicated Expressway|KL-KLIA Dedicated Expressway]]
| group5 = Prime applications
| list5 =
* [[Wikipedia:E-Government|E-Government]]* [[Wikipedia:MyKad|MyKad]]
| below = Below text goes here
}}
{{{{PAGENAMETDOC}}
| name = Navbox/doc
| title = [[File:Blason France moderne.svg|x17px|link=|alt=]] [[File:Flag of France.svg|x17px|link=|alt=]] [[Wikipedia:French colonial empire|Former French overseas empire]]
| state = uncollapsed
| list1 = {{{{PAGENAMETDOC}}|child
| navbar = plain
| title = [[Wikipedia:French colonial empire|Former French colonies]] in [[Wikipedia:Africa|Africa]] and the [[Wikipedia:Indian Ocean|Indian Ocean]]
| listclass = hlist
| group1 = [[Wikipedia:Mahgreb|Mahgreb]]
| list1 =
* [[Wikipedia:French rule in Algeria|Algeria]]* [[Wikipedia:French Morocco|Morocco]] <small>([[Wikipedia:Arguin|Arguin Island]])</small>* [[Wikipedia:History of Tunisia|Tunisia]] | group2 = [[Wikipedia:French West Africa|French West Africa]]
| list2 =
* [[Wikipedia:History of Côte d'Ivoire#French Period|Côte d'Ivoire]]* [[Wikipedia:French Dahomey|Dahomey]]* [[Wikipedia:French Sudan|French Sudan]]* [[Wikipedia:French Guinea|Guinea]]* [[Wikipedia:History of Mauritania#French colonization and post-colonial history|Mauritania]]* [[Wikipedia:History of Niger#Colonization|Niger]]* [[Wikipedia:History of Senegal|Senegal]]* [[Wikipedia:French Upper Volta|Upper Volta]]* [[Wikipedia:French Togoland|French Togoland]]* [[Wikipedia:James Island (The Gambia)|James Island]]| group3 = [[Wikipedia:French Equatorial Africa|French Equatorial Africa]]
| list3 =
* [[Wikipedia:Colonial Chad|Chad]]* [[Wikipedia:History of Gabon|Gabon]]* [[Wikipedia:History of the Republic of the Congo|Middle Congo]]* [[Wikipedia:Oubangui-Chari|Oubangui-Chari]]| group4 = [[Wikipedia:Comoros|Comoros]]
| list4 =
* [[Wikipedia:Anjouan|Anjouan]]* [[Wikipedia:Grande Comore|Grande Comore]]* [[Wikipedia:Mohéli|Mohéli]]* [[Wikipedia:History of Djibouti#French Interest|French Somaliland (Djibouti)]]* [[Wikipedia:History of Madagascar#French control|Madagascar]]* [[Wikipedia:Mauritius|Ile de France]]* [[Wikipedia:Seychelles|Seychelles]]
}}
| list2 = {{{{PAGENAMETDOC}}|child
| navbar = plain
| title = [[Wikipedia:French colonial empire|Former French colonies]] in the [[Wikipedia:Americas|Americas]]
| listclass = hlist
| list1 =
* [[Wikipedia:New France|New France]]{{spaces|2}}<small>([[Wikipedia:Acadia|Acadia]], [[Wikipedia:Louisiana (New France)|Louisiana]], [[Wikipedia:Canada, New France|Canada]], [[Wikipedia:Newfoundland (island)|Terre Neuve]]) 1655–1763 </small>
| list2 =
* [[Wikipedia:Inini|Inini]]* [[Wikipedia:Berbice|Berbice]]* [[Wikipedia:Saint-Domingue|Saint-Domingue]]* <small>[[Wikipedia:Haiti|Haiti]]</small>* [[Wikipedia:Tobago|Tobago]]* [[Wikipedia:History of the British Virgin Islands|Virgin Islands]]* [[Wikipedia:France Antarctique|France Antarctique]]* [[Wikipedia:France Équinoxiale|France Équinoxiale]]| below = [[Wikipedia:French West India Company|French West India Company]]
}}
| list3 = {{{{PAGENAMETDOC}}|child
| navbar = plain
| title = [[Wikipedia:French colonial empire|Former French colonies]] in [[Wikipedia:Asia|Asia]] and [[Wikipedia:Oceania|Oceania]]
| listclass = hlist
| group1 = [[Wikipedia:French India|French India]]
| list1 =
* [[Wikipedia:Chandernagor|Chandernagor]]* [[Wikipedia:Coromandel Coast|Coromandel Coast]]* [[Wikipedia:History of Chennai|Madras]]* [[Wikipedia:Mahé, India|Mahé]]* [[Wikipedia:History of Pondicherry|Pondichéry]]* [[Wikipedia:Karaikal|Karaikal]]* [[Wikipedia:Yanam (India)|Yanaon]]| group2 = [[Wikipedia:French Indochina|French Indochina]]
| list2 =
* [[Wikipedia:Colonial Cambodia|Cambodia]]* [[Wikipedia:History of Laos to 1945#French Laos|Laos]]* [[Wikipedia:French Indochina|Vietnam]] <small>([[Wikipedia:Annam (French colony)|Annam]], [[Wikipedia:Cochinchina|Cochinchina]], [[Wikipedia:Tonkin|Tonkin]])</small>
| group3 = Other Asian
| list3 =
* [[Wikipedia:Alawite State|Alaouites]]* [[Wikipedia:Republic of Hatay|Alexandretta-Hatay]]* [[Wikipedia:Sri Lanka|Ceylon]]* [[Wikipedia:Kwangchowan|Kwangchowan]]| group4 = [[Wikipedia:Oceania|Oceania]]
| list4 =
* [[Wikipedia:New Hebrides|New Hebrides]]** [[Wikipedia:History of Vanuatu|Vanuatu]]| below = [[Wikipedia:French East India Company|French East India Company]]
}}
}}
# If the heading of the navbox spans more than one line, the second line will be displayed to the right of center. This can be avoided by hard-coding linebreaks with {{tag|br|single|params=clear="all"}}.
# In Internet Explorer 8 and 9, there is a bug when using <code>hlist</code>; navbox will fail to wrap the list to the next line if the list items start with an image, causing navbox to extend its width outside the screen. This can be fixed by adding <code>&amp;nbsp;</code> in front of the images.
# Excessive use of the '''unsubstituted''' {{tlx|•}} template as a delimiter, can in extreme cases cause the wiki page rendering to fail&nbsp;— there is a limit to the number of templates that can be used on a page (example [[Wikipedia:Ketamine|Ketamine]] where the inclusion of eleven Navboxes with hundreds of bullets caused the page load not to complete, only the substitution of the bullets in those navboxes cured the problem). Use of the <code>hlist</code> class avoids the delimiter transclusion issue altogether, as the delimiters are rendered via CSS.
== See also ==
* {{tl|Sidebar}} — Vertically-aligned navigation templates.
* [[Template:Navbox/testcases]] — For additional examples of template code.
* [[Wikipedia:Line-break handling|Line-break handling]] — The how-to guide about how to handle word wraps (line breaks) on Wikipedia, such as the wrapping of the link lists used in navboxes.* [[Wikipedia:Template documentation|Template documentation]] — Guideline to creating the accompanying documentation
* {{tl|Nowrap begin}}, {{tl|·}} and {{tl|•}} are '''deprecated''' in favor of the <code>hlist</code> class for formatting lists. See [[Template:Flatlist#Technical details|Flatlist]] for a technical explanation of how <code>hlist</code> works.

Navigation menu