Template:Navbox/doc

From The World of Gotha
Revision as of 22:58, 18 January 2025 by Jph2 (talk | contribs) (→‎Parameters)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This is a documentation subpage for Template:Navbox.
It may contain usage information, categories and other content that is not part of the original template page.

The {{navbox}} template makes setting up a navigation template simple by supplying it with one or more lists of links. It supports up to 15 groups of links. The title, sub-title, footer, and group name background colors may be customized using web colors (names or hex code being the most common formats). An image may be optionally displayed at the right of the box.

Usage

To use the template, copy and paste the following in a new template page (for example, Template:Countryname topics). Then add the appropriate parameter values.

{{Navbox
| title            = 
| title_background = 
| state            = 
| above            = 
| above_background = 
| image            =
| image_size       =
| image_alt        =
| group_background = 
| group1           = 
| list1            = 
| group2           = 
| list2            =  
<!-- ... -->
| below            = 
| below_background = 
}}

Parameters

Optional parameters are not displayed if left blank.

Parameter Description Type Status Notes
title Navbox title String Required
title_background Title bar background color String Optional Defaults to #ccccff ()
state Collapsed or expanded initial display String Optional Default is collapsed; set to expanded for expanded initial display
above Sub-title or upper explanatory text String Optional
above_background Sub-title bar background color String Optional Defaults to #ddddff ()
image Image filename String Optional
image_size Image size String Optional Default is 80px. Note: Presently does not display properly unless the parameter is removed or has a value.
image_alt Image alternate text String Optional
group_background Group cell background color String Optional Defaults to #ddddff ()
group1 Group1 description String Optional
list1 First group list String Required Displays full-width if group1 is omitted or blank
groupn Additional group description(s) String Optional Up to 15 total groups and lists are supported
listn Additional group list(s) String Optional Associated group must have a value to display. For example, if group2 is empty, list2 will not display.
below Footer String Optional
below_background Footer bar background color String Optional Defaults to #ddddff ()

Example

{{Navbox
| title            = Subject articles
| above            = Example of a navbox
| group1           = First group
| list1            = [[First article]] ● [[Second article]]
| group2           = Second group
| list2            =  [[Another article]] ● [[Last article]]
| below            = [[:Category:Templates|Category]]
}}
Subject articles
Example of a navbox
First group First articleSecond article

Second group Another articleLast article
Category