Module:Navbox/doc: Difference between revisions
From Fanon Wiki
(Created page with "This module allows to generate a navbox in an easier way, with automatic items, or links, and/or colors. <big>'''This module is not intended to be invoked if it's not a template'''</big> ==Basic example== <pre> {{#invoke:Navbox|MODE|bg=BGCOLOR|text=TEXTCOLOR|TITLE| Head / Item; Item; Item; Item Head / Item; Item; Item Head / Item; Item; Item; Item Head / Item; Item; Item ... }} </pre> To set each item, break a line after the invocation and start with the title of the...") |
mNo edit summary |
||
Line 5: | Line 5: | ||
==Basic example== | ==Basic example== | ||
<pre> | <pre> | ||
{{#invoke:Navbox|MODE|bg=BGCOLOR|text=TEXTCOLOR|TITLE| | {{#invoke:Navbox|MODE|bg=BGCOLOR|expand=COLLAPSE|text=TEXTCOLOR|TITLE| | ||
Head / Item; Item; Item; Item | Head / Item; Item; Item; Item | ||
Head / Item; Item; Item | Head / Item; Item; Item | ||
Line 24: | Line 24: | ||
* Optional: <code>bg=BGCOLOR</code> — sets the background and border color of the navbox. Replace <code>BGCOLOR</code> with a hex, hsv, hsl, rgb, or rgba value. | * Optional: <code>bg=BGCOLOR</code> — sets the background and border color of the navbox. Replace <code>BGCOLOR</code> with a hex, hsv, hsl, rgb, or rgba value. | ||
* Optional: <code>text=TEXTCOLOR</code> — sets the text color of the title and "headers". Black by default. If changed, it's recommended to be white (<code>#ffffff</code>) in 99.9% of cases. | * Optional: <code>text=TEXTCOLOR</code> — sets the text color of the title and "headers". Black by default. If changed, it's recommended to be white (<code>#ffffff</code>) in 99.9% of cases. | ||
* Optional: <code>expand=COLLAPSE</code> — makes the navbox collapsed by default. It can be any given value, however, use the word "Collapsed" to be more clear. | |||
==Demo== | ==Demo== | ||
{{#invoke:Navbox|list|bg=#0ae744|text=#000 | {{#invoke:Navbox|list|bg=#0ae744|text=#000|My Title| | ||
Asia / Japan; China; Korea; India; Indonesia; Iran | Asia / Japan; China; Korea; India; Indonesia; Iran | ||
Africa / Egypt; Tanzania; Morocco; Gabon | Africa / Egypt; Tanzania; Morocco; Gabon | ||
Line 36: | Line 37: | ||
<pre> | <pre> | ||
{{#invoke:Navbox|list|bg=#0ae744|text=#000 | {{#invoke:Navbox|list|bg=#0ae744|text=#000|My Title| | ||
Asia / Japan; China; Korea; India; Indonesia; Iran | Asia / Japan; China; Korea; India; Indonesia; Iran | ||
Africa / Egypt; Tanzania; Morocco; Gabon | Africa / Egypt; Tanzania; Morocco; Gabon |
Revision as of 22:46, 17 May 2022
This module allows to generate a navbox in an easier way, with automatic items, or links, and/or colors.
This module is not intended to be invoked if it's not a template
Basic example
{{#invoke:Navbox|MODE|bg=BGCOLOR|expand=COLLAPSE|text=TEXTCOLOR|TITLE| Head / Item; Item; Item; Item Head / Item; Item; Item Head / Item; Item; Item; Item Head / Item; Item; Item ... }}
To set each item, break a line after the invocation and start with the title of the row, which is represented on the example above as Head
. This is the "header" of each row in the table. Then split it with a forward slash and add your item, then split each item with a semicolon.
Remember that each section needs to be in the same row! If you break a line it will start a new section.
- MANDATORY:
MODE
— sets the mode of the navbox. The available ones are:list
: adds an item normally, but without links automatically. To set a link to each page you need to add MediaWiki's[[syntax]]
manually. This is recommended for most cases.autolink
: each item will be turn into a link automatically, soItem
will have a link to the page called "Item". This is good for some situations, but it can have some limitations.
- MANDATORY:
TITLE
— sets the title of the navbox. OBS: even if the mode is set toautolink
, the navbox needs a manually-placed link. - Optional:
bg=BGCOLOR
— sets the background and border color of the navbox. ReplaceBGCOLOR
with a hex, hsv, hsl, rgb, or rgba value. - Optional:
text=TEXTCOLOR
— sets the text color of the title and "headers". Black by default. If changed, it's recommended to be white (#ffffff
) in 99.9% of cases. - Optional:
expand=COLLAPSE
— makes the navbox collapsed by default. It can be any given value, however, use the word "Collapsed" to be more clear.
Demo
{{#invoke:Navbox|list|bg=#0ae744|text=#000|My Title| Asia / Japan; China; Korea; India; Indonesia; Iran Africa / Egypt; Tanzania; Morocco; Gabon South America / Argentina; Colombia; Brazil North America / Canada; United States; Jamaica; Mexico Europe / Austria Moon / Mario; Knuckles }}