Template:Navbox/doc

This is a meta-template for building navboxes. A navbox is a grouping of links used in multiple related articles to facilitate navigation between those pages.

Up to 20 headers/blocks with up to 20 content/group fields each are supported, as well as displaying the rows in a column-based or horizontal layout and making groups collapsible. Each of these options can be specified for individual blocks or the whole navbox. In addition, navboxes built with this meta-template can be nested/displayed within each other. The template also supports displaying images to the left and/or right of individual blocks or the whole navbox.

Standard navboxes (i.e. those inserted at the bottom of an article) are collapsible and will be auto-collapsed by default (this can be changed by altering the autocollapse limit in MediaWiki:Common.js).

Usage
is a metatemplate, meaning it is a template for other templates. So, a navbox, FFVI, will be built using "Navbox" as its base code, and once created, a user only needs to add  to the bottom of an article for it to be put in place. This code is primarily for building other navboxes, not for being used on articles.

Easy navbox creation
The box below allows you to create a new with the appropriate layout. Simply enter the name of the new navbox ("Template:Navbox" is automatically added) and click the "Create" button.

Options parameters
The various options (often referred to as an  param) are to be used when the navbox is different to the default setting. For instance, changing to side navboxes, changing whether a navbox should be collapsible, or changing things such as the width. Some parameters should be used more sparingly than others.

Class parameters
The  options in order to change based on already set CSS classes in the Common.css. This option is essential to most navboxes. While most times, simply applying a class to an entire navbox normally works, there may be times where more than one is useful. Classes can be found here.

Style parameters
Unlike, the   options should be used sparingly as they can lead to visual inconsistencies. They are often preferred when a css class does not exist to be used.

Simple
A simple usage of the navbox would be:

results in:

Every navbox is required to include an editlink, a class, a title, and at least some content. These are the bare necessities for every navbox. Note, that if only a single "contents" exists, it is more likely that the navbox will become a side navbox instead (more on those later).

Functionality and explanations
The basic functionality of the Navbox metatemplate's parameters used in practice to construct navboxes will be explained here.

"Standard" refers to groups, blocks and headers. Standard (image)=

results in:

As shown about, all the "A" content is grouped under the "A" block, however, all the "B" content is grouped not only under the "B" block, but under a collapsible header. The image is applied to the right of the entire navbox. Standard (block images)=

results in:

The images here were applied to the "A" and "B" contents, as opposed to the entire box. When adding images to large navboxes, this is always preferred. Note, that if "blocks" were used instead of "headers", the same result would be produced. The same result would also be produced if neither headers nor blocks were used. Columns (entire navbox)=

results in:

By simply changing the "options" value to add "columns", the navbox's contents now don't add new rows, but new columns. Groups appear in the row above contents. Note, that while groups can be added, and will appear in the row above the contents, they are not preferred. To add contents in a row below, simply add them to a different letter. Be careful when adding more than 10 to a row, as while doable, it will often look untidy and make the contents unnecessarily small. Columns (standard rows mixed)=

results in:

The options parameter does not just apply to the entire navbox, it can apply to individual letters. Sometimes colums are preferred, though sometimes they are not. Side navbox=

For some navboxes, particularly ones with less content, using the "position" parameter and setting it to either left or right can make it a side navbox. This is often useful when the navbox is only meant to make lists. Note, that it is important, though unnecessary, to specify the width of the side navboxes, in order to give the contents more room. Also note that the side navs prefer listing things with "*" and "#" (the bullet points will not actually show, but numbers will). Nested navboxes=

Nested navboxes are especially useful when more information is needed under a header. Particularly, for navboxes when multiple blocks are needed in the contents under what would otherwise be a header. Since placing multiple blocks under a header is impossible, a nested navbox fills that role. Otherwise, they are often unnecessary, as headers can already be styled, classed, given images and other functions normally; that, and the number of contents should almost never exceed 20, though if they do, nested navboxes can be added.

Customization features
The Navbox metatemplate is designed to allow for plenty of customization to its appearance. Through the use of  and   parameters, the metatemplate can be applied used for every situation and colored based on the wiki's own classes, which are based on the games. It also allows for bg images.

Class=

results in:

Adding  pulled up the Cael class from the Wiki's Common.css, and colored the entire template automatically as an Cael template. It did not, however, provide title text or a bg image. This is because, while the navbox is an Cael navbox, it is not an Cael navbox for the whole game. Multiple classes=

results in:

While the template was classed like an  template, for the whole thing, as headers B and C referred to other games, they were classed as such, so   and   were used as classes specified only for them. Style=

results in:

The navbox was given a yellow background color and its text was aligned to the left. This was applied to everything in the navbox. This style is in contrast to the class, used, which in this case was DEV. Multiple styles=

results in:

Here, the title has been made red, while everything in A was given a green background. Only the header of B was given a background, which was yellow. The texts in the contents have been aligned differently. Everything else, however, has gone by the default, which was the Cael class. Title text and bg image=

results in:

Filling in the "editlink" triggers the bg image. It identifies that the navbox being built is a navbox for the game, and deserves the bg image and title text.

Examples in use
Examples of navboxes actually in use are as follows:
 * AESeries
 * Uses bg image, class, headers, and a nested navbox


 * Armor
 * Uses columns, headers


 * Magic
 * Uses multiple different classes, headers, blocks, and nested navboxes


 * Translations
 * Uses positioning (as a sidenav)

Technical
This metatemplate is fairly complicated. Editing it requires a good understanding of parser functions and wiki syntax. For help editing, or using, contact the designers for help.

Auxiliaries
The metatemplate also uses several "auxiliary" templates in its construction. The main purpose of these is to simplify the amount of content on the main metatemplate, and make it easier to edit.


 * Navbox/aux
 * Merges various input parameters, calculates row/column counts for a given block and passes results to aux2 or aux3 (depending on the specified layout type).


 * Navbox/aux2
 * Returns a whole block of standard rows according to options and specified cells.


 * Navbox/aux3
 * Returns a whole block of columns according to options and specified cells.

Background images
The navboxes which use a background image (referred to as "bg" image) import the images from the Common.js and Common.css, which are hosted on the AQ wiki. The images are all 170x30 in resolution. Anyone can upload an image for the navboxes.

The background images should only be featured on navboxes for the game in question. They are triggered by the "editlink" param (see above). Since the navbox name will be identical to the game's class and code name, the editlink should be too, meaning it will activate the js and css.

The images can be found on Navbox/doc/bgimagegallery.

When a background image is used, the titletext replaces normal text.

Documentation for all navboxes
A documentation exists for the individual navboxes, as opposed to just this metatemplate.

It can be found on Navbox/doc/standard.