Module:Navbox/doc: Difference between revisions

From Fanon Wiki
mNo edit summary
mNo edit summary
 
Line 6: Line 6:
<pre>
<pre>
{{#invoke:Navbox|MODE|bg=BGCOLOR|expand=COLLAPSE|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
Head / Item; Item; Item; Item
Head // Item; Item; Item; Item
Head / Item; Item; Item
Head // Item; Item; Item
...
...
}}
}}
Line 28: Line 28:
==Demo==
==Demo==
{{#invoke:Navbox|list|bg=#0ae744|text=#000|My Title|
{{#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
South America / Argentina; Colombia; Brazil
South America // Argentina; Colombia; Brazil
North America / Canada; United States; Jamaica; Mexico
North America // Canada; United States; Jamaica; Mexico
Europe / Austria
Europe // Austria
Moon / Mario; Knuckles
Moon // Mario; Knuckles
}}
}}


<pre>
<pre>
{{#invoke:Navbox|list|bg=#0ae744|text=#000|My Title|
{{#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
South America / Argentina; Colombia; Brazil
South America // Argentina; Colombia; Brazil
North America / Canada; United States; Jamaica; Mexico
North America // Canada; United States; Jamaica; Mexico
Europe / Austria
Europe // Austria
Moon / Mario; Knuckles
Moon // Mario; Knuckles
}}
}}
</pre>
</pre>
[[Category:Modules]]
[[Category:Modules]]

Latest revision as of 17:54, 10 June 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, so Item 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 to autolink, the navbox needs a manually-placed link.
  • Optional: bg=BGCOLOR — sets the background and border color of the navbox. Replace BGCOLOR 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
}}