Editing
Template:Navbox/doc
(section)
Jump to navigation
Jump to search
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 parameters === :; ''name''* :: The name of the template, which is needed for the "V β’ T β’ E" ("View β’ Talk β’ Edit") links to work properly on all pages where the template is used. You can enter <code><nowiki>{{subst:PAGENAME}}</nowiki></code> for this value as a shortcut. The name parameter is only mandatory if a <code>title</code> is specified, and the <code>border</code> parameter is not set. :; ''state''* <span style="font-weight:normal;">[<code>autocollapse, uncollapsed, collapsed, plain, off</code>]</span> :* Defaults to <code>autocollapse</code>. A navbox with <code>autocollapse</code> will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. For the technically minded, see [[MediaWiki:Common.js]]. :* If set to <code>collapsed</code>, the navbox will always start out in a collapsed state. :* If set to <code>plain</code>, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the <small>V β’ T β’ E</small> links). :* If set to <code>off</code>, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered. This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden. :* If set to anything other than <code>autocollapse</code>, <code>collapsed</code>, <code>plain</code>, or <code>off</code> (such as "uncollapsed"), the navbox will always start out in an expanded state, but have the "hide" button. : To show the box when standalone (non-included) but then auto-hide contents when in an article, put "uncollapsed" inside <noinclude> tags: :* <code>state = </code><nowiki><noinclude>uncollapsed</noinclude></nowiki> :* That setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]" but then auto-collapse the box when stacked inside an article. : Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this: :* In your intermediate template, create a parameter also named "state" as a pass-through like this: :* <code><nowiki>| state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}</nowiki></code> :* The <nowiki><includeonly>|</nowiki> will make the template expanded when viewing the template page by itself. ::* Example: {{tl|peso}} with autocollapse as the default initial state. [[Catalan peseta]] transcludes it and has only one navbox. So the peso navbox shows. [[Chilean peso]] has two navboxes. So the peso navbox collapses. ::* Example: {{tl|Historical currencies of Hungary}} with expanded as the default initial state. All transcluding articles shows the content by default, unless there were an hypothetical article that specifies state = collapsed when transcluding. :* The template {{tl|Collapsible option}} can be added to a <nowiki><noinclude></nowiki> section after the template definition to explain how to use the <code>state</code> parameter. :; ''navbar''* :: If set to <code>plain</code>, the <span style="font-size: 88%;">V β’ T β’ E</span> links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered. Use <code>off</code> to remove the <span style="font-size: 88%;">V β’ T β’ E</span> links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). It is highly recommended that one not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages. :; ''border''* :: ''See section hereafter on using navboxes within one another for examples and a more complete description.'' If set to <code>child</code> or <code>subgroup</code>, then the navbox can be used as a borderless child that fits snugly in another navbox. The border is hidden and there is no padding on the sides of the table, so it fits into the ''list'' area of its parent navbox. If set to <code>none</code>, then the border is hidden and padding is removed, and the navbox may be used as a child of another container (do not use the <code>none</code> option inside of another navbox; similarly, only use the <code>child</code>/<code>subgroup</code> option inside of another navbox). If set to anything else (default), then a regular navbox is displayed with a 1px border. An alternate way to specify the border to be a subgroup style is like this (i.e. use the first unnamed parameter instead of the named ''border'' parameter): ::: <code><nowiki>{{Navbox|child</nowiki></code> :::: <code>... ::: <code><nowiki>}}</nowiki></code>
Summary:
Please note that all contributions to 2d4chan may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, 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 (see
2d4chan:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Template
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information