Template:Navbox: Difference between revisions

From PZwiki
(added to list of navbox templates)
m (changed navbox businesses to locations)
 
(22 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>
<noinclude>
{{#ifexpr:{{{1}}}=0|
{{Documentation/sandbox|doc =
{{!}}-
{{Protection|This template is considered '''High Risk''' as it is used on multiple pages.}}
{{!}} style="width:200px;font-weight:bold; background-color: {{{titlebg|#eee}}}; padding-left: 1em; padding-right: 1em;" {{!}} {{{title|title}}}
This is a metatemplate used to quickly create a navigational template in a standardized style.
{{!}} {{{content|content}}}
 
{{{extra|
Navboxes are used to provide a convenient way to navigate between related articles. They are not always related to the article directly, but are instead related to the overarching topic. E.g., [[Template:Navbox weapons]], or [[Template:Navbox locations]]. They will usually be placed at the bottom of an article in the "see also" section.
{{!}}}
 
}}}|{{{!}} class="collapsible" style="background-color: #f9f9f9; border: 1px solid #aaa; font-size: 90%;margin-left: auto;margin-right: auto;padding: 2px; text-align: center; width: 80%;"
==Usage==
! colspan="2" style="border: 1px solid #aaa; font-weight:bold; font-size: 110%;background-color: {{{mainbg|#ccf}}};color:#000; padding-left: 1em; padding-right: 1em;" {{!}} <span style="float:left;">{{Vde|{{{name|Navbox}}}}}</span>{{{main}}}
<pre>{{Navbox
{{!}}-
| title = Example
{{!}} style="width:200px;font-weight:bold; background-color: {{{titlebg|#eee}}}; padding-left: 1em; padding-right: 1em;" {{!}} {{{title|title}}}
| content = {{Navbox/row
{{!}} {{{content|content}}}
  | group = group1
{{{extra|
  | list = list, list, list, list, list, list, list, list, list, list, list, list,
{{!}}}
  }}
}}}}}</includeonly><noinclude>{{languages}}
| id = example
}}</pre>
 
===Parameters===
;<code>title</code> {{sup|required}}
:Title.
;<code>content</code> {{sup|required}}
:Container for the content. {{tll|Navbox/row}} will usually be here.
;<code>id</code> {{sup|required}}
:The unique ID for the navbox.
;<code>image</code>
:Image to be displayed beneath the title and next to the content.
;<code>above</code>
:Displayed beneath the title but below the content.
;<code>below</code>
:Displayed beneath the content.
;<code>theme</code>
:Color of the navbox, can be <code>blue</code> or <code>red</code>. Default is <code>red</code>.
;<code>collapsed</code>
:Initial state of the content. Will be collapsed by default (<code>true</code>). Set to <code>false</code> to start expanded.
 
'''''The following are from {{tll|Navbox/row}}.'''''
;<code>group</code>
:Group name. Used from {{tll|Navbox/row}}
;<code>list</code>
:List of articles to be linked to. Usually separated with a bullet point <code>&bull;</code> or {{code|&bull;}}
 
==Examples==
{{Navbox
| title = Example
| collapsed = false
| above = above
| below = below
| content = {{Navbox
  | title = Sub-title
  | collapsed = false
  | above = above
  | content = {{Navbox/row
    | group = group1
    | list = list, list, list, list, list, list, list, list, list, list, list, list,
    }}{{Navbox/row
    | group = group1
    | list = list, list, list, list, list, list, list, list, list, list, list, list, list, list, list, list, list,
    }}{{Navbox/row
    | group = group1
    | list = list, list, list, list, list, list, list, list, list, list, list, list, list, list, list, list, list,
  }}
  | id = sub
  | image = [[File:Image.png|80px]]
  | theme = blue
  }}
| image = [[File:Image.png|100px]]
| id = sample
}}
 
{{Translation guide}}


==See also==
{{Navbox see also}}
}}


<pre>{{Navbox|1
{{ll|Category:Navbox}}
|name=Navbox
</noinclude><includeonly><div class="navbox theme-{{#switch:{{{theme|}}}|blue=blue|#default=red}}" style="clear: both;">
|mainbg=#ccf
  <div>{{#if:{{{title|}}}|{{{title}}}|Title}}<!--## Start temporary show/hide ##
|main=test navbox
--><span class="mw-customtoggle-navbox-{{{id|}}}" title="{{int:show}} / {{int:hide}}" style="float:right; padding-right:30px; padding-top:4px; font-size:0.7em; font-weight:normal;">{{int:show}} / {{int:hide}}</span><!--
|titlebg=#00f
## End temporary show/hide ## --></div>
|title=1
  <div class="mw-collapsible {{yesno|{{{collapsed|yes}}}|yes=mw-collapsed}}" id="mw-customcollapsible-navbox-{{{id|[[Category:Incorrect template usage]]}}}">
|content=This works fine for one row, but if you..
    {{#if:{{{above|}}}|<div class="navbox-row">{{{above}}}</div>}}
|extra={{Navbox|0|titlebg=#f00|title=2|content=..add another navbox template in with '0' for the first parameter..
    <div class="navbox-section">
|extra={{Navbox|0|titlebg=#0f0|title=3|content=it allows you to add more.}}}}}}</pre><br><br>{{Navbox|1
      <div>{{{content|}}}</div>
|name=Navbox
      {{#if:{{{image|}}}|<div>{{{image}}}</div>}}
|mainbg=#ccf
    </div>
|main=test navbox
    {{#if:{{{below|}}}|<div class="navbox-row">{{{below}}}</div>}}
|titlebg=#00f
  </div>
|title=test1
  <div class="toggle mw-customtoggle-navbox-{{{id|}}}" title="{{int:show}} / {{int:hide}}"></div>
|content=This works fine for one row, but if you..
</div></includeonly>
|extra={{Navbox|0|titlebg=#f00|title=test2|content=..add another navbox template in with '0' for the first parameter..
|extra={{Navbox|0|titlebg=#0f0|title=test3|content=it allows you to add more.}}}}}}<br><br><br><br>Navbox templates:<br>
* [[Template:Navbox/Baggage]]
* [[Template:Navbox/Clothing]]
* [[Template:Navbox/Construction]]
* [[Template:Navbox/Consumables]]
* [[Template:Navbox/Electricity and Engineering]]
* [[Template:Navbox/Farming]]
* [[Template:Navbox/Tools]]
* [[Template:Navbox/Weapons]]
</noinclude>
<noinclude>
[[category:Templates]]
</noinclude>

Latest revision as of 09:04, 6 March 2024

Notebook.pngTemplate Documentation
Lock-locked.png
This page has been put into protection by a PZwiki administrator.
Reason: This template is considered High Risk as it is used on multiple pages.
Only users in the sysop user group may edit this page.

This is a metatemplate used to quickly create a navigational template in a standardized style.

Navboxes are used to provide a convenient way to navigate between related articles. They are not always related to the article directly, but are instead related to the overarching topic. E.g., Template:Navbox weapons, or Template:Navbox locations. They will usually be placed at the bottom of an article in the "see also" section.

Usage

{{Navbox
| title = Example
| content = {{Navbox/row
  | group = group1
  | list = list, list, list, list, list, list, list, list, list, list, list, list, 
  }}
| id = example
}}

Parameters

title Required
Title.
content Required
Container for the content. {{Navbox/row}} will usually be here.
id Required
The unique ID for the navbox.
image
Image to be displayed beneath the title and next to the content.
above
Displayed beneath the title but below the content.
below
Displayed beneath the content.
theme
Color of the navbox, can be blue or red. Default is red.
collapsed
Initial state of the content. Will be collapsed by default (true). Set to false to start expanded.

The following are from {{Navbox/row}}.

group
Group name. Used from {{Navbox/row}}
list
List of articles to be linked to. Usually separated with a bullet point or &bull;

Examples

How to translate

This template doesn't need to/shouldn't be translated, but you can translate the documentation of this template with the following steps:

  1. Create a subpage of this template with the language code of the language you want to translate to.
  2. Copy the code wrapped in the <noinclude> tag in this template into the page you created.
    {{Translation guide}} template should be removed from the translated documentation.
  3. Translate the page according to the translation requirements of normal pages.

See also

Editors can experiment in this template's sandbox.