Template:Navbox/doc

From FORwiki

Revision as of 21:14, 24 December 2009 by Admin (Talk | contribs)
Jump to: navigation, search

This template allows a navigational template to be set up relatively quickly by supplying it one or more lists of links. It comes equipped with default styles that should work for most navigational templates. Changing the default styles is not recommended, but is possible. Using this template, or one of its "Navbox suite" sister templates, is highly recommended for standardization of navigational templates, and for ease of use.

Contents

Usage

Please remove the parameters that are left blank.

{{Navbox
|bodyclass  = 
|name       = {{subst:PAGENAME}}
|title      = 
|titleclass = 
|image      = 
|above      = 

|group1     = 
|list1      = 

|group2     = 
|list2      = 
 ...
|group20    = 
|list20     = 

|below      = 
}}

Parameter list

The navbox uses lowercase parameter names, as shown in the box (at right). The mandatory name and title will create a one-line box if other parameters are omitted.

Notice "group1" (etc.) is optional, as are sections named "above/below".
The basic and most common parameters are as follows (see below for the full list):

bodyclass - applies an HTML class attribute to the entire navbox.
name - the name of the template.
title - text in the title bar, such as: [[Widget stuff]].
titleclass - applies an HTML class attribute to the title bar.
state - autocollapse, uncollapsed, collapsed: the status of box expansion, where "autocollapse" hides stacked navboxes automatically.
titlestyle - a CSS style for the title-bar, such as: background:gray;
groupstyle - a CSS style for the group-cells, such as: background:#eee;
image - an optional right-side image, coded as the whole image. Typically it is purely decorative, so it should be coded as [[Image:XX.jpg|90px|link=|alt=]].
imageleft - an optional left-side image (code the same as the "image" parameter).
above - text to appear above the group/list section (could be a list of overall wikilinks).
groupn - the left-side text before list-n (if group-n omitted, list-n starts at left of box).
listn - text listing wikilinks, often separated by middot templates, such as: [<font/>[A]]{<font/>{·}} [<font/>[B]]
below - optional text to appear below the group/list section.

Further details, and complex restrictions, are explained below under section Parameter descriptions. See some alternate navbox formats under: Layout of table.


Layout of table

Table generated by {{Navbox}} without image, above and below parameters (gray list background color added for illustration only):


Table generated by {{Navbox}} with image, above and below parameters (gray list background color added for illustration only):


Table generated by {{Navbox}} with image, imageleft, lists, and without groups, above, below (gray list background color added for illustration only):

Examples

No image

{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| group1 = Centre
| list1  = [[Cyberjaya]]

| group2 = Area
| list2  = [[Klang Valley]]

| group3 = Major landmarks
| list3  = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}}
  [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}}
  [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}}
  [[Kuala Lumpur International Airport]]

| group4 = Infrastructure
| list4  = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]

| group5 = Prime applications
| list5  = [[EGovernment]]{{·}} [[MyKad]]
}}

With image, without groups

{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| image = [[Image:Flag of Malaysia.svg|80px|link=|alt=]]
| list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}} 
  [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}}
  [[Putrajaya]]{{·}} [[Cyberjaya]]{{·}}
  [[Kuala Lumpur International Airport]]
}}

With two images, without groups, multiple lists

{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| image = [[Image:Flag of Malaysia.svg|80px|link=|alt=]]
| imageleft = [[Image:Flag of Malaysia.svg|80px]]
| list1 = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}}
   [[Kuala Lumpur Sentral]]
| list2 = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]
| list3 = [[EGovernment]]{{·}} [[MyKad]]
| list4 = [[Klang Valley]]
}}

With image, groups, above, below

{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| image = [[Image:Flag of Malaysia.svg|80px|link=|alt=]]

| above = Above text goes here

| group1 = Centre
| list1  = [[Cyberjaya]]

| group2 = Area
| list2  = [[Klang Valley]]

| group3 = Major landmarks
| list3  = [[Petronas Twin Towers]]{{·}} [[Kuala Lumpur Tower]]{{·}}
  [[Kuala Lumpur Sentral]]{{·}} [[Technology Park Malaysia]]{{·}}
  [[Putrajaya]]{{·}} [[Cyberjaya]]

| group4 = Infrastructure
| list4  = [[Express Rail Link]]{{·}} [[KL-KLIA Dedicated Expressway]]

| group5 = Prime applications
| list5  = [[EGovernment]]{{·}} [[MyKad]]

| below  = Website: [http://www.msc.com.my/ www.msc.com.my]
}}

Child navboxes

It is possible to place multiple navboxes within a single border with the use of the border parameter, or by specifying the first parameter to be "child". The basic code for doing this is as follows (which adds a subgroup for the first group/list area):

{{Navbox
|name = {{subst:PAGENAME}}
|title = Title

|group1 = [optional]
|list1 = {{Navbox|child
   ...child navbox parameters...
 }}

...
}}

Subgroups example

This example shows how subgroups can be used. It is recommended that one uses {{Navbox subgroup}}, but the same result can be reached by using {{Navbox}} with border = child or the first unnamed parameter set to child. Note that the evenodd parameter is used to reverse striping in some of the subgroups in order to get all of the stripes to line up properly. If you wish to remove the striping altogether, you can set liststyle = background:transparent; in each of the navboxes.

Multiple show/hides in a single container

The example below is generated using a regular navbox for the main container, then its list1, list2, and list3 parameters each contain another navbox, with border = child set. Note that each of the child navboxes has its own VDE navbar; these could be hidden using navbar = plain for each of them, or by just leaving out the name parameter (child navboxes do not require the name parameter to be set, unlike regular navboxes).


Relationship with other Navbox templates

This navbox template is specifically designed to work in conjunction two other sister templates: {{Navbox with columns}} and {{Navbox with collapsible groups}}. All three of these templates share common parameters for consistency and ease of use (such parameters are marked with a in the complete parameter list above). Most importantly, all three of these templates can each be used as children of one another (by using the border = child parameter, or by specifying the first unnamed parameter to be child (i.e. use {{Navbox|child, {{Navbox with columns|child, or {{Navbox with collapsible groups|child). For examples on how this is done, see the page on advanced navbox examples.

Personal tools