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!
===== Setup ===== ; {{Color|var(--color-option-orange, #a95226)|{{Sup|β }}}}{{Spaces|1|fig}}{{Parameter|name}}{{Anchor|Name}} : The name of the template, which is needed for the {{VTE|t|e|template=Navbox}} links to work properly on all pages where the template is transcluded; the shortcut value {{Template link general|code=on|subst=on|PAGENAME}} can be assigned as it will be automatically replaced with the correct value when saved. This parameter is only required if the {{Parameter|title}} parameter is defined but neither the {{Parameter|border}} or {{Parameter|navbar}} parameters (which disable the navbar) are as well. ; {{Color|var(--color-option-orange, #a95226)|{{Sup|β }}}}{{Spaces|1|fig}}{{Parameter|state|{{Nobold|{{pval|autocollapse}}{{pval|collapsed}}{{pval|expanded}}{{pval|plain}}{{pval|off}}}}}}{{Anchor|Autocollapse}} :* {{Parameter|state|autocollapse}} '''''(default)''''' β The navbox is collapsed if there are two or more additional collapsible elements on the transcluding page, otherwise it will be expanded. For the technically-minded, perform a full-text search for {{pval|autocollapse}} on [[MediaWiki:Common.js]] to review the underlying JavaScript. :* {{Parameter|state|collapsed}} β The navbox always loads in the collapsed state. :* {{Parameter|state|expanded}} β The navbox always loads in the expanded state. :* {{Parameter|state|plain}} β The navbox always loads in the expanded state and the {{Code[hide]}} link on the right is suppressed, while the title remains centered (CSS {{Code|padding:|css}} is used to offset the <small>V β’ T β’ E</small> links). :* {{Parameter|state|off}} β As above, the navbox always loads in the expanded state with no {{Code|[hide]}} link on the right, however no CSS padding is used to keep the title centered. This is for advanced use only; the {{Code|plain}} option should suffice for most instances where the {{Code|[show]}}/{{Code|[hide]}} button needs to be hidden. : To have the navbox load in the expanded state when not transcluded and in the collapsed state when it is, use {{Xtag|noinclude|o}} tags to wrap the value for the non-transcluded behavior (e.g., {{Tag|noinclude|p|content=expanded}}). : Frequently, editors will wish to override a navbox's default initial state in transcluding pages on a case-by-case basis. This is easily accomplished by duplicating the {{Source parameter|state}} parameter in the new navbox and adding a fallback value to it of the desired default behavior keyword wrapped in {{Xtag|includeonly|o}} tags. This allows any explicitly-defined values for the parameter to be passed through as-is to [[Template:Navbox]] without affecting the non-transcluded default state. :* For example, {{Parameter|state|<syntaxhighlight lang="wikitext" inline="1" class="nowrap" style="border: none;">{{{state<includeonly>|desired_default</includeonly>}}}</syntaxhighlight>}} will show the navbox expanded when viewing it on its own template page and yet remain auto-collapsed anywhere else it is transcluded without an explicit value defined for {{Source parameter|state}}. :* A more determinative approach is with {{Parameter|state|<syntaxhighlight lang="wikitext" inline="1" class="nowrap" style="border: none;">{{{state|<includeonly>desired_transcluded_default</includeonly><noinclude>desired_non-transcluded_default</noinclude>}}}</syntaxhighlight>}}, where the parameter value passed to {{Template link general|Navbox}} on the template's own page would be {{Code|desired_non-transcluded_default}} while remaining {{Code|desired_transcluded_default}} wherever the navbox is transcluded. :** Example 1: {{Template link general|Aesthetics}} with {{Code|autocollapse}} as the default initial state. Most articles transclude it alongside other navboxes so it collapses automatically, but it's expanded on its own template page because it is the only navbox present. :** Example 2: {{Template link general|Historical currencies of Hungary}} whose default initial state is {{Code|expanded}} as implemented in the template source code with {{Parameter|state|<syntaxhighlight lang="wikitext" inline="1" class="nowrap" style="border: none;">{{{state<includeonly>|expanded</includeonly>}}}</syntaxhighlight>}}. All transcluding articles show the content by default, unless there is a hypothetical article that specifies {{Template link general|code=on|Historical currencies of Hungary|2=state=collapsed}} when transcluding. :** Example 3: {{Template link general|Alveolata}} with {{Code|collapsed}} as the default initial state, from the parameter configuration {{Parameter|state|<syntaxhighlight lang="wikitext" inline="1" class="nowrap" style="border: none;">{{{state<includeonly>|collapsed</includeonly>}}}</syntaxhighlight>}}. All transcluding articles will show the template as collapsed by default, but the template will still be uncollapsed when displayed on its own page. : The template {{Template link general|Collapsible option}} explains how to use the {{Source parameter|state}} parameter. It can be added to a {{Xtag|noinclude|p}} section after the template definition, or to the instructions on the {{Template link general|Documentation subpage}}. ; {{Color|var(--color-option-orange, #a95226)|{{Sup|β }}}}{{Spaces|1|fig}}{{Parameter|navbar|{{Nobold|{{pval|plain}}{{pval|off}}}}}}{{Anchor|Navbar}} :* {{Parameter|navbar|plain}} β Removes the {{Navbar|1={{NAMESPACE}}:{{BASEPAGENAME}}|mini=on}} links on the left side of the titlebar and automatically recalculates the CSS padding values to keep the title visually centered. :* {{Parameter|navbar|off}} β Removes the {{Navbar|1={{NAMESPACE}}:{{BASEPAGENAME}}|mini=on}} links, but does not alter the CSS padding to compensate (this is for advanced use only; the {{Code|plain}} option should suffice for most instances where a navbar is not desired). : It is strongly recommended that the navbar should not be hidden so that users can easily edit the template as needed, and to keep a standard style across pages. ; {{Color|var(--color-option-orange, #a95226)|{{Sup|β }}}}{{Spaces|1|fig}}{{Parameter|border|{{Nobold|{{pval|child}}{{pval|subgroup}}{{pval|none}}}}}}{{Anchor|Border}} :* {{Parameter|border|child}} or {{Parameter|border|subgroup}} β Allows the navbox to be used as a borderless child that nests cleanly within another navbox, removing the outer border and the lateral padding so that it fits into one of the {{Parameter|list{{Sub|{{Var|N}}}}}} areas of the parent navbox. :* {{Parameter|border|none}} β Removes the outer border and lateral padding from the navbox so it may be used as the child of another container (do not use the {{Code|none}} option inside of another navbox, only the {{Code|child}}{{Spaces|thin}}/{{Spaces|thin}}{{Code|subgroup}} keyword values are appropriate for nesting navboxes). :* If unset '''''(default)''''', then a regular navbox is displayed with a one-pixel-wide border. An alternate way to specify the border to be a subgroup style is with the first unnamed/positional parameter alias, as {{Template link general|code=on|Navbox|2=child|3=β¦}} :: βΊ {{Hatnote inline|See the {{Section link|#Child navboxes}} section for practical examples and a more complete description of using navboxes within one another.}}
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