Template:Navbox: Difference between revisions

From NPOWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:
   <table class="mw-collapsible {{#ifeq:{{{state|}}}|collapsed|mw-collapsed}}">
   <table class="mw-collapsible {{#ifeq:{{{state|}}}|collapsed|mw-collapsed}}">
     <tr>
     <tr>
       <th class="navbox-title" colspan="2"><span style="font-size:larger;">{{{title}}}</span></th>
       <th class="navbox-title" colspan="2"><span style="font-size:larger;">{{#if:{{{title|}}}|{{{title}}}|{{#if:{{{template|}}}|{{{template}}}|{{{title}}}}}}}</span></th>
     </tr>
     </tr>
     <tr>
     <tr>
Line 13: Line 13:
{{#if:{{{group2|}}}{{{list2|}}}|
{{#if:{{{group2|}}}{{{list2|}}}|
     <tr>
     <tr>
       {{#if:{{{group2|}}}|
       {{#if:{{{group2|}}}
         <th class="navbox-group">{{{group2}}}dsajflkdsf</th>
         |<th class="navbox-group">{{{group2}}}</th>
        |{{#if:{{{list2|}}}|{{#if:{{{group1|}}}|{{error|Mixed heading usage}}}}}}
       }}<td class="navbox-list">
       }}<td class="navbox-list">
{{{list2}}}
{{{list2}}}

Revision as of 01:51, 23 August 2020

Documentation [edit]

This template is used to display a box containing various links related to a particular subject. It is meant to be used by other templates that are then used on pages, rather than using this one directly. A list of navboxes can be found here. Navboxes should be placed at the bottom of a page, below everything else.

To create documentation for a navbox implementation, use Template:Navbox/box doc.

Parameters

  • style - (optional) any styling to be applied to the navbox, such as width. Use sparingly; most styling should be in site CSS. This is put directly in the style attribute.
  • state - (optional) use this to change the default state of the navbox - "collapsed" or "expanded". The default is expanded. This parameter should usually be passed through ( |state = {{{state|}}} ) so that the state can be changed on individual pages if necessary.
  • title - the heading of the navbox.
  • group1 through group15 - the heading to use for each group of links. These are all optional; if omitted, the list parameters will be centered in the navbox, which can be useful for particular types of navboxes. Each defined heading requires an accompanying list. You cannot mix rows with and without headings.
  • list1 through list15 - the content for each group. Usually you will want to use {{list}} with the default settings to create a bullet-separated list. You can use lists without headings, but you cannot mix rows with and without headings. At least one list is required.
  • links - (optional) any additional links to display in the navbox footer, before the specific links in parameters below. Usually you will want to use {{list}} with the default settings to create a bullet-separated list consistent with the other links (not necessary if only including one link).
  • portal - (optional) the title of the portal page for this topic (not including "Portal:").
  • category - (optional) the title of the category specific to this topic.
  • template (required) - the title of the navbox template using this template. This is used to create the view/edit link, so it must be correct.
  • nogap (optional) - if multiple navboxes are always used together in succession, use this to remove the spacing between them. Should be placed on any navboxes after the first. The value just needs to be non-empty. See {{Emperors}} for an example.
  • nofooter (optional) - if non-empty, this will hide the footer with links. This should be used very sparingly as it will make the template harder for editors to find.

Skeleton

You can start a navbox template with this general skeleton. You should delete any unused group/link sets. Don't forget to use {{list}} for the list parameters.

{{Navbox
|title = 
|state = {{{state|}}}
|group1 = 
|list1 = 
|group2 = 
|list2 = 
|group3 = 
|list3 = 
|group4 = 
|list4 = 
|group5 = 
|list5 = 
|group6 = 
|list6 = 
|group7 = 
|list7 = 
|group8 = 
|list8 = 
|group9 = 
|list9 = 
|links = 
|portal = 
|category = 
|template = {{subst:PAGENAME}}
}}<noinclude>{{documentation}}</noinclude>

The above documentation is transcluded from Template:Navbox/doc.