Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Home
Random page
Pages on topics near you
Recent changes
Special pages
Search
Search
Appearance
Create account
Log in
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Editing
Template
:
Navbox/doc
(section)
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Child navboxes == {{Selfref|For additional examples, see the [[Template:Navbox/testcases|template testcases]] page.}} It is possible to place multiple navboxes within a single border. These can either be specified inline or by using a [[#Child navboxes|nested or "child" navbox]] template, although the latter method can result in a significantly large [[Help:Template limits|post-expand include size]]. To specify [[#Child navboxes|nested or "child" navboxes]] inline, set the [[#List|{{Mono|list{{Sub|{{Var|N}}}}}}]] parameter value as {{Code|child}} or {{Code|subgroup}}. Elements of the child navbox can be specified by prepending <code>child{{Sub|{{Var|N}}}}_</code>, <code>subgroup{{Sub|{{Var|N}}}}_</code> or just <code>{{Sub|{{Var|N}}}}_</code> to the parameter names (e.g., {{Code|1_list1}}). Another level of nested navboxes can be added with an additional prefix (e.g., {{Code|1_1_list1}}). The basic code for doing this is as follows (which adds a subgroup for the first group/list): <syntaxhighlight lang="wikitext" style="box-sizing: border-box; margin-left: 2rem; width: 67vw;">{{Navbox | name = {{subst:PAGENAME}} | title = Title | group1 = [optional] | list1 = child | 1_title = [optional] | 1_group1 = [optional] | 1_list1 = child | 1_1_title = [optional] | 1_1_group1 = [optional] | 1_1_list1 = …list contents… … … }}</syntaxhighlight> To specify child navboxes using a nested template supply {{Code|child}} as the value to its first unnamed/positional parameter, or set the {{Parameter|border}} parameter. The basic code for doing this is as follows (which adds a subgroup for the first group/list): <syntaxhighlight lang="wikitext" style="box-sizing: border-box; margin-left: 2rem; width: 67vw;">{{Navbox | name = {{subst:PAGENAME}} | title = Title | group1 = [optional] | list1 = {{Navbox|child …child navbox parameters… }} … }}</syntaxhighlight> === Subgroups example === This example shows two subgroups and an even deeper nested sub-subgroup created using {{Code|child}} or {{Code|subgroup}} keywords (they are equivalent and interchangeable); the striping is alternated automatically. To remove the striping altogether, set the {{Parameter|child{{Sub|{{Var|N}}}}_liststyle|background-color: transparent;}} parameter in each one. {{{{PAGENAMETDOC}} | name = Navbox/doc | state = uncollapsed | title = Multiple subgroup example | above = Above | below = Below | group1 = Group1 | list1 = List1 | group2 = Group2 | list2 = child | child2_group1 = Group2.1 | child2_list1 = List1 | child2_group2 = Group2.2 | child2_list2 = List2 | child2_group3 = Group2.3 | child2_list3 = List3 | group3 = Group3 | list3 = List3 | group4 = Group4 | list4 = subgroup | subgroup4_group1 = Group4.1 | subgroup4_list1 = List1 | subgroup4_group2 = Group4.2 | subgroup4_list2 = List2 | subgroup4_group3 = Group4.3 | subgroup4_list3 = child | subgroup4_child3_group1 = Group 4.3.1 | subgroup4_child3_list1 = List1 | subgroup4_child3_group2 = Group 4.3.2 | subgroup4_child3_list2 = List2 }} ==== Relationship with other Navbox templates ==== This navbox template works in conjunction with two other templates: {{Template link general|Navbox with columns}} and {{Template link general|Navbox with collapsible groups}}. All three of these templates share common parameters for consistency and ease of use (they are marked with a preceding superscript orange star ({{Color|var(--color-option-orange, #a95226)|{{Sup|★}}}}…) in the [[#Descriptions|parameter descriptions]] above). Most importantly, they can all be used as child templates of one another. Using the inline notation, the <code>{{Sub|{{Var|N}}}}_type</code> parameter can be set to the values {{Code|with columns}} or {{Code|with collapsible groups}} to activate the compatibility for that type of child navbox, as shown in the example below. {{Collapse|title=Deeply nested navbox example source code|content=<syntaxhighlight lang="wikitext" style="box-sizing: border-box; margin-left: 2rem; width: 80vw;">{{Navbox | name = Template:Navbox/doc | title = Navbox with nested regular Navbox, Navbox with Collapsible Groups, and Navbox with Columns | listclass = hlist<!-- Note that this applies to the child navboxes unless explicitly set otherwise. --> | group1 = Regular Navbox | list1 = subgroup | 1_group1 = Group 1 | 1_list1 = * List 1.1 * List 1.2 | 1_group2 = Group 2 | 1_list2 = * List 2.1 * List 2.2 | group2 = Navbox with Collapsible Groups | list2 = subgroup | 2_type = with collapsible groups | 2_group1 = Group 1 | 2_list1 = * List 1.1 * List 1.2 | 2_group2 = Group 2 | 2_list2 = * List 2.1 * List 2.2 | group3 = Navbox with Columns | list3 = subgroup | 3_type = with columns | 3_col1header = Column 1 | 3_col1 = * List 1.1 * List 1.2 | 3_col2header = Column 2 | 3_col2 = * List 2.1 * List 2.2 | list11 = subgroup | 11_title = Regular Navbox | 11_group1 = Group 1 | 11_list1 = * List 1.1 * List 1.2 | 11_group2 = Group 2 | 11_list2 = * List 2.1 * List 2.2 | list12 = subgroup | 12_title = Navbox with Collapsible Groups | 12_type = with collapsible groups | 12_group1 = Group 1 | 12_list1 = * List 1.1 * List 1.2 | 12_group2 = Group 2 | 12_list2 = * List 2.1 * List 2.2 | list13 = subgroup | 13_title = Navbox with Columns | 13_type = with columns | 13_col1header = Column 1 | 13_col1 = * List 1.1 * List 1.2 | 13_col2header = Column 2 | 13_col2 = * List 2.1 * List 2.2 }}</syntaxhighlight>}} {{Navbox | name = Template:Navbox/doc | title = Navbox with nested regular Navbox, Navbox with Collapsible Groups, and Navbox with Columns | listclass = hlist<!-- Note that this applies to the child navboxes unless explicitly set otherwise. --> | group1 = Regular Navbox | list1 = subgroup | 1_group1 = Group 1 | 1_list1 = * List 1.1 * List 1.2 | 1_group2 = Group 2 | 1_list2 = * List 2.1 * List 2.2 | group2 = Navbox with Collapsible Groups | list2 = subgroup | 2_type = with collapsible groups | 2_group1 = Group 1 | 2_list1 = * List 1.1 * List 1.2 | 2_group2 = Group 2 | 2_list2 = * List 2.1 * List 2.2 | group3 = Navbox with Columns | list3 = subgroup | 3_type = with columns | 3_col1header = Column 1 | 3_col1 = * List 1.1 * List 1.2 | 3_col2header = Column 2 | 3_col2 = * List 2.1 * List 2.2 | list11 = subgroup | 11_title = Regular Navbox | 11_group1 = Group 1 | 11_list1 = * List 1.1 * List 1.2 | 11_group2 = Group 2 | 11_list2 = * List 2.1 * List 2.2 | list12 = subgroup | 12_title = Navbox with Collapsible Groups | 12_type = with collapsible groups | 12_group1 = Group 1 | 12_list1 = * List 1.1 * List 1.2 | 12_group2 = Group 2 | 12_list2 = * List 2.1 * List 2.2 | list13 = subgroup | 13_title = Navbox with Columns | 13_type = with columns | 13_col1header = Column 1 | 13_col1 = * List 1.1 * List 1.2 | 13_col2header = Column 2 | 13_col2 = * List 2.1 * List 2.2 }} You can also nest these or other navbox templates by assigning the keyword {{Code|child}} as the value of the first unnamed/positional parameter or the named {{Parameter|border}} parameter (e.g., {{Template link general|plaincode=on|Navbox|child|…}}, {{Template link general|plaincode=on|Navbox with columns|2=1=child|3=…}} or {{Template link general|plaincode=on|Navbox with collapsible groups|2=border=child|3=…}}). Note that this style of nesting can lead to a large increase in the template's [[Help:Template limits|post-expand include size]]. === Multiple visibility toggles === {{Main|Template:Navbox with collapsible groups}} The example below is generated using a regular navbox for the main container with its {{Parameter|list{{Sub|{{Var|N}}}}}} parameters all assigned the value {{Code|child}} (e.g., {{Parameter|list1|child}}, {{Parameter|list2|child}}, …). The <span class="plainlinks" style="font-size: 0.88em; margin: 0; padding: 0; white-space: collapse nowrap;"><span style="margin: 0; word-spacing: -0.125em;">[[Template:Navbox|<abbr style="border-bottom: none; cursor: inherit; font-variant: small-caps; text-decoration: none;" title="View this template">v</abbr>]]</span> · <span style="margin: 0; word-spacing: -0.125em;">[[Template talk:Navbox|<abbr style="border-bottom: none; cursor: inherit; font-variant: small-caps; text-decoration: none;" title="Discuss this template">t</abbr>]]</span> · <span style="margin: 0; word-spacing: -0.125em;">[[Special:EditPage/Template:Navbox|<abbr style="border-bottom: none; cursor: inherit; font-variant: small-caps; text-decoration: none;" title="Edit this template">e</abbr>]]</span></span> links are hidden automatically because the "child" or "subgroup" keyword is used, so defining {{Parameter|navbar|plain}} for each of them is not necessary. The code <code>{{Var|N}}_state = <nowiki>{{#ifeq:{{{selected|}}}|ABBREVIATION|uncollapsed|{{{stateN|collapsed}}}}}</nowiki></code> is used to replicate the {{Parameter|abbr{{Sub|{{Var|N}}}}|ABBREVIATION}} functionality of {{Template link general|Navbox with collapsible groups}}. {{{{PAGENAMETDOC}} | name = Navbox/doc | title = [[French colonial empire|Former French overseas empire]] | state = uncollapsed | list1 = child | 1_state = {{#ifeq:{{{selected|}}}|Africa|uncollapsed|{{{state1|collapsed}}}}} | 1_title = [[French colonial empire|Former French colonies]] in [[Africa]] and the [[Indian Ocean]] | 1_listclass = hlist | 1_group1 = [[Mahgreb]] | 1_list1 = * [[French rule in Algeria|Algeria]] * [[French Morocco|Morocco]] <small>([[Arguin|Arguin Island]])</small> * [[History of Tunisia|Tunisia]] | 1_group2 = [[French West Africa]] | 1_list2 = * [[History of Côte d'Ivoire#French colonial era|Côte d'Ivoire]] * [[French Dahomey|Dahomey]] * [[French Sudan]] * [[French Guinea|Guinea]] * [[History of Mauritania#French colonization and post-colonial history|Mauritania]] * [[History of Niger#Colonization|Niger]] * [[History of Senegal|Senegal]] * [[French Upper Volta|Upper Volta]] * [[French Togoland]] * [[James Island (The Gambia)|James Island]] | 1_group3 = [[French Equatorial Africa]] | 1_list3 = * [[Colonial Chad|Chad]] * [[History of Gabon|Gabon]] * [[History of the Republic of the Congo|Middle Congo]] * [[Oubangui-Chari]] | 1_group4 = [[Comoros]] | 1_list4 = * [[Anjouan]] * [[Grande Comore]] * [[Mohéli]] * [[History of Djibouti#French Interest|French Somaliland (Djibouti)]] * [[History of Madagascar#French control|Madagascar]] * [[Mauritius|Ile de France]] * [[Seychelles]] | list2 = child | 2_state = {{#ifeq:{{{selected|}}}|Americas|uncollapsed|{{{state2|collapsed}}}}} | 2_title = [[French colonial empire|Former French colonies]] in the [[Americas]] | 2_listclass = hlist | 2_list1 = * [[New France]]{{spaces|2}}<small>([[Acadia]], [[Louisiana (New France)|Louisiana]], [[Canada, New France|Canada]], [[Newfoundland (island)|Terre Neuve]]) 1655–1763 </small> | 2_list2 = * [[Inini]] * [[Berbice]] * [[Saint-Domingue]] * <small>[[Haiti]]</small> * [[Tobago]] * [[History of the British Virgin Islands|Virgin Islands]] * [[France Antarctique]] * [[France Équinoxiale]] | 2_below = [[French West India Company]] | list3 = child | 3_state = {{#ifeq:{{{selected|}}}|Asia|uncollapsed|{{{state3|collapsed}}}}} | 3_title = [[French colonial empire|Former French colonies]] in [[Asia]] and [[Oceania]] | 3_listclass = hlist | 3_group1 = [[Asia]] | 3_list1 = child | 3_1_group1 = [[French India]] | 3_1_list1 = * [[Chandernagor]] * [[Coromandel Coast]] * [[History of Chennai|Madras]] * [[Mahé, India|Mahé]] * [[History of Pondicherry|Pondichéry]] * [[Karaikal]] * [[Yanam (India)|Yanaon]] | 3_1_group2 = [[French Indochina]] | 3_1_list2 = * [[Colonial Cambodia|Cambodia]] * [[History of Laos to 1945#French Laos|Laos]] * [[French Indochina|Vietnam]] <small>([[Annam (French colony)|Annam]], [[Cochinchina]], [[Tonkin]])</small> | 3_1_group3 = Other Asian | 3_1_list3 = * [[Alawite State|Alaouites]] * [[Republic of Hatay|Alexandretta-Hatay]] * [[Sri Lanka|Ceylon]] * [[Kwangchowan]] | 3_group4 = [[Oceania]] | 3_list4 = * [[New Hebrides]] ** [[History of Vanuatu|Vanuatu]] | 3_below = [[Louis XIV's East India Company|French East India Company]] }}
Summary:
Please note that all contributions to Wikifacta are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 International License. A few of Wikifacta's pages are from Wikipedia.org's Mainspace and Draftspace. (see
Wikifacta:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Template
:
Navbox/doc
(section)
Add topic