Template:Navbox: Difference between revisions

From PZwiki
m (Changed protection settings for "Template:Navbox": High risk template. Avoid excessive edits ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
(added show/hide to improve UX, as discussed on discord. --this is intended as a temporary solution to the problem of inexperienced readers potentially not knowing it can be expanded)
Line 77: Line 77:
{{ll|Category:Navbox}}
{{ll|Category:Navbox}}
</noinclude><includeonly><div class="navbox theme-{{#switch:{{{theme|}}}|blue=blue|#default=red}}" style="clear: both;">
</noinclude><includeonly><div class="navbox theme-{{#switch:{{{theme|}}}|blue=blue|#default=red}}" style="clear: both;">
   <div>{{#if:{{{title|}}}|{{{title}}}|Title}}</div>
   <div>{{#if:{{{title|}}}|{{{title}}}|Title}}<!--## Start temporary show/hide ##
--><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><!--
## End temporary show/hide ## --></div>
   <div class="mw-collapsible {{yesno|{{{collapsed|yes}}}|yes=mw-collapsed}}" id="mw-customcollapsible-navbox-{{{id|[[Category:Incorrect template usage]]}}}">
   <div class="mw-collapsible {{yesno|{{{collapsed|yes}}}|yes=mw-collapsed}}" id="mw-customcollapsible-navbox-{{{id|[[Category:Incorrect template usage]]}}}">
     {{#if:{{{above|}}}|<div class="navbox-row">{{{above}}}</div>}}
     {{#if:{{{above|}}}|<div class="navbox-row">{{{above}}}</div>}}
Line 86: Line 88:
     {{#if:{{{below|}}}|<div class="navbox-row">{{{below}}}</div>}}
     {{#if:{{{below|}}}|<div class="navbox-row">{{{below}}}</div>}}
   </div>
   </div>
   <div class="toggle mw-customtoggle-navbox-{{{id|}}}"></div>
   <div class="toggle mw-customtoggle-navbox-{{{id|}}}" title="{{int:show}} / {{int:hide}}"></div>
</div></includeonly>
</div></includeonly>

Revision as of 11:40, 26 January 2024

Hammer.png
This template is currently under construction.
It is in the process of an expansion or major restructuring. You are welcome to assist in its construction by editing it as well.
If this page has not been updated in a while, please replace this notice with {{Improve}}. Last edit was 26/01/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.