Template:Navbox: Difference between revisions
PhantomCaleb (talk | contribs) (Created page with "<includeonly>{{#invoke:Navbox|Main}}</includeonly><noinclude>{{Documentation}}</noinclude>") |
PhantomCaleb (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#invoke:Navbox|Main}}</includeonly><noinclude>{{Documentation}}</noinclude> | <includeonly><templatestyles src="Template:Navbox/Styles.css"/>{{#invoke:Navbox|Main}}</includeonly><noinclude>{{Documentation}}</noinclude> |
Latest revision as of 14:08, 6 November 2022
Purpose
Creates navbox templates.
Usage
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |footer= }}
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |group3= |links3= |footer= }}
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |group3= |links3= |group4= |links4= |footer= }}
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |group3= |links3= |group4= |links4= |group5= |links5= |footer= }}
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |group3= |links3= |group4= |links4= |group5= |links5= |group6= |links6= |footer= }}
{{Navbox |id= |title= |titleImages= |image= |group1= |links1= |group2= |links2= |group3= |links3= |group4= |links4= |group5= |links5= |group6= |links6= |group7= |links7= |footer= }}
Parameter | Status | Description | Default value |
---|---|---|---|
id | optional | A unique ID for the navbox. Sets the id HTML attribute so that the navbox can be linked to. Defaults to the navbox title. | |
title | required | The navbox title. It is recommended not to place links in the title as this can create confusion between the clickable navbox header and the link within it. Category links should be placed in the footer. | |
titleImages | optional | Two file names with the File: prefix, separated by a comma. Renders image to the left and right of the navbox title. | |
image | optional | A file name, with the File: prefix. Renders an image in the navbox body. | |
groupN | optional | A header for the given row in the navbox. Required if there is more than one row. | |
linksN | required | A comma-separated list of links for the given row. | |
maxGroupSizeN | optional | Adds the template to Category:Navigation templates needing attention if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | 16 |
footer | optional | The navbox footer. Usually contains links to relevant categories. |
Creates [[:Category:Navbox templates|navbox templates]].
Parameter | Description | Type | Status | |
---|---|---|---|---|
id | id | A unique ID for the navbox. Sets the [https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id id HTML attribute] so that the navbox can be linked to. Defaults to the navbox title. | String | optional |
title | title | <p>The navbox title.</p><p>It is recommended not to place links in the title as this can create confusion between the clickable navbox header and the link within it. Category links should be placed in the footer.</p> | Content | required |
titleImages | titleImages | Two file names with the <code>File:</code> prefix, separated by a comma. Renders image to the left and right of the navbox title. | String | optional |
image | image | A file name, with the <code>File:</code> prefix. Renders an image in the navbox body. | File | optional |
footer | footer | The navbox footer. Usually contains links to relevant categories. | Content | optional |
group1 | group1 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links1 | links1 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize1 | maxGroupSize1 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group2 | group2 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links2 | links2 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize2 | maxGroupSize2 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group3 | group3 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links3 | links3 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize3 | maxGroupSize3 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group4 | group4 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links4 | links4 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize4 | maxGroupSize4 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group5 | group5 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links5 | links5 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize5 | maxGroupSize5 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group6 | group6 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links6 | links6 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize6 | maxGroupSize6 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
group7 | group7 | A header for the given row in the navbox. Required if there is more than one row. | String | optional |
links7 | links7 | A comma-separated list of links for the given row. | Content | required |
maxGroupSize7 | maxGroupSize7 | Adds the template to [[:Category:Navigation templates needing attention]] if the number of links in the group exceeds this number. In most cases this value should not be set higher than its default; navboxes with too many links per group can be difficult to read. | Number | optional |
Examples
{{Navbox |id= la-trading-sequence |title= {{LA|-}} Trading Sequence |titleImages= File:LADX Yoshi Doll Sprite.png, File:LADX Magnifying Lens Sprite.png |links1= {{Term List|LANS|Yoshi Doll, Ribbon, Dog Food, Bananas, Stick, Honeycomb, Pineapple, Hibiscus, Goat's Letter, Broom, Fishing Hook, Necklace, Scale, Magnifying Lens|link= }} |footer= [[Trading Sequence|Trading Sequences]] }}
{{Navbox |id= sage-medallions |title = Sage Medallions in {{OoT|-}} |titleImages= File:OoT3D Light Medallion Icon.png, File:OoT3D Spirit Medallion Icon.png |links1= {{Term|OoT3D|Sage Medallion|link}} |links2= {{Term List|OoT3D|Light Medallion, Forest Medallion, Fire Medallion, Water Medallion, Shadow Medallion, Spirit Medallion|link= }} |footer = [[:Category:Sage Medallions]] }}
{{Navbox |id= characters |title= Character Listings by Game |image= File:Carpenters.png |group1= Main Series |links1= {{#invoke:Franchise List|GameLinks|type= main|link= Characters in $shortName}} |group2= Spin-offs |links2= {{#invoke:Franchise List|GameLinks|type= spin-off|link= Characters in $shortName}} |footer= [[:Category:Characters|Characters]] • [[:Category:Listings|Listings]] }}
title
is required
{{Navbox |links1= bar |links2= baz }}
Guidelines
- A navbox must contain links to every page that uses it, and only those pages. Otherwise the navbox is not bidirectional and can lead to "dead ends."
- A navbox must not contain red links.
- Each navbox row should have 16 links or less, in most cases.
If a navbox fails to meet any of these conditions, the template page is added to Category:Navigation templates needing attention. A Report
section is automatically generated which describes what needs to be fixed.
Notes
This template transforms internal links into external links masquerading as internal links, using the plainlinks class. This is to avoid cluttering Special:WhatLinksHere. As a side effect, navboxes display red links as if they were links to pages that exist. Therefore, navboxes should not contain any red links, otherwise users can click the link expecting to land on an article and be (unpleasantly) surprised to have been brought to a dead end.
See Also
- Template:Categories: Automatically adds navboxes based on categories
- Template:Categories/Navbox: Customizes the automatic category navboxes
- MediaWiki:Gadget-Navbox.js: Enhances navbox behavior with JavaScript