Template:Navbar/Documentation

From GodWiki
Jump to: navigation, search

Usage

{{Navbar}} adds navbar navigational functionality to navigational templates (navboxes and infoboxes), when placed inside a template's code and passed the name of the enclosing template, e.g:

{{navbar|{{subst:PAGENAME}}|mini=y}}
{{navbar|{{subst:PAGENAME}}|plain=y}}
{{navbar|{{subst:PAGENAME}}|fontstyle=color: green; font-style: italic;}}

The {{subst:PAGENAME}} will be substituted with the template's name when parsed by the servers. For example...

This wikicode 
{{navbar|Navbar/Documentation}}
produces 

Parameters

Required parameters

{{Navbar|Template Name}}
The template name is required.

Optional parameters

Format and positioning

|mini=y 
If set, creates a mini navbar of single-letter links and no preceding text. For example:
|float= 
Set to right to position the navbar to the right of other content, or center to disable flowing around the navbar entirely. (default: left)
Note: The mini-navbar uses an implied text-align style matching the value of the float parameter, or the default left. (This is why center is useful to disable floating, as it will properly center the text inside its enclosing <div>.)
Because of this, when using |mini=y it is preferable to override the float by setting |float=right/center. Setting |style=float: right/none; will not remove the default text-align: left;, and may produce undesirable results.

Content

|noedit=y 
Set to disable the Edit link in the navbar, displaying only View and Talk.
|brackets=y 
Set to enclose the navbar links in square brackets ([ and ]).
|plain=y 
If this parameter is set, the line of text before the navbar links ("This box:", by default) is removed entirely. Enabled by default when |mini=y is set.
|text= 
Set to overrride the text preceding the navbar links in the full-size navbar. Has no effect when |mini=y is set. (default: "This box:")

Appearance

|style= 
Set to define CSS styles that will be applied to the <div>...</div> surrounding the entire navbar. Use valid CSS rules, with semicolon endings. DO NOT enclose in quotation marks.
|fontstyle= 
Set to define CSS styles that will be applied to the <span>...</span> around the navbar's text strings (all displayed text). Use valid CSS rules, with semicolon endings. DO NOT enclose in quotation marks.

Examples

Options Parameters Produces...
Basic {{navbar|Template Name}}
Different text {{navbar|Template Name|text=This template:}}
Without "This box:" text {{navbar|Template Name|plain=y}}
Short version {{navbar|Template Name|mini=y}}
With brackets {{navbar|Template Name|brackets=y}}
Without Edit {{navbar|Template Name|noedit=y}}
With font styling examples (<span>) {{navbar|Template Name|fontstyle=color: green; font-style: italic;}}
With whole-template styling examples (<div>) {{navbar|Template Name|style=float:right; background: Beige; padding: 5px; border: 1px solid;}}

Notes

Navbar is contained within a <div>...</div> in order to accommodate a horizontal unnumbered list. This means it cannot be placed inside a <span>...</span> or other inline element.