Difference between revisions of "Template:Navbox with columns/doc"

From Ava Zinn Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
m (Robot: updating redirected category)
(updating doc)
Line 19: Line 19:
  
 
== Parameters ==
 
== Parameters ==
Required parameters in '''bold'''.
+
Required parameters in '''bold'''. Parameters marked with a cross'''<sup>†</sup>''' are parameters in common with the sister template {{t1|Navbox}}.  A much more complete description of those parameters is available there.
{| class="wikitable" style="line-height:1.3em; font-size:95%;"
+
 
|style="width:6.5em;"| '''''name''''' || The name of the template. The name of this template, for example, is "Navigation with columns".</tr>
+
===Setup parameters===
| ''state''        || Possible values are <code>collapsed</code>, <code>uncollapsed</code>, and the default <code>autocollapse</code>.</tr>
+
:;name<sup>†</sup>
| ''titlestyle''   || [[Wikipedia:CSS|CSS]] style/s to apply to titlebar; usually <code>background:''color''</code> (background defaults to [[Wikipedia:NavFrame|NavHead]] default).</tr>
+
::The name of the template. The name of this template, for example, is "Navigation with columns".
| '''''title''''' || The title of the template, displayed centered in the titlebar at the top of the template.</tr>
+
 
| ''bodystyle''   || CSS style/s to apply to the template's body (i.e. including space not used by columns)</tr>
+
:;state<sup>†</sup>
| ''abovestyle''   || CSS style/s to apply to the ''above'' parameter.</tr>
+
::Possible values are <code>collapsed</code>, <code>uncollapsed</code>, <code>plain</code>, <code>off</code>, and the default <code>autocollapse</code>.  
| ''above''       || Text or other elements to appear above the columns.</tr>
+
 
| ''image''       || Image to the right of all of the columns.</tr>
+
:;''navbar''<sup>†</sup>
| ''imageleft''   || Image to the left of all of the columns.</tr>
+
::Possible values are <code>plain</code>, <code>off</code>, and the default value of blank.
| ''colwidth''     || Width, preferably in a proportional unit such as '[[Em (typography)|em]]', used for each column whose width not specified by ''colNwidth'' below. Defaults to 10em.</tr>
+
 
| ''padding''     || Padding before first column, preferably in a proportional unit. Defaults to 5em.</tr>
+
:;''border''<sup>†</sup>
| ''colsstyle''   || CSS style/s to apply across all columns; if used, usually <code>background:''color''</code> per ''titlestyle'' above.</tr>
+
::Possible values are <code>child</code>, <code>none</code>, and the default value of blank.
| ''oddcolstyle'' || CSS style/s to apply to all odd-numbered columns (again, if used, usually <code>background:''color''</code>).</tr>
+
 
| ''evencolstyle'' || CSS style/s to apply to all even-numbered columns (ditto).</tr>
+
===Basic data parameters===
| ''col1width''   || First column's width (overrides ''colwidth'' above).</tr>
+
:;'''''title'''''<sup>†</sup>
| ''col1style''    || CSS style/s to apply to the first column.</tr>
+
::The title of the template, displayed centered in the titlebar at the top of the template.
| '''''col1'''''  || First column's content.</tr>
+
 
| ''col2width''    || Second column's width (overrides ''colwidth'' above).</tr>
+
:;''above''<sup>†</sup>
| ''col2style''    || CSS style/s to apply to the second column.</tr>
+
:Text or other elements to appear above the columns.
| '''''col2'''''   || Second column's content.</tr>
+
 
| ''col3width''   || Third column's width (overrides ''colwidth'' above).</tr>
+
:;''image''<sup>†</sup>
| ''col3style''   || CSS style/s to apply to the third column.</tr>
+
::Image to the right of all of the columns.
| ''col3''         || Third column's content.</tr>
+
 
| ......          || ......</tr>
+
:;''imageleft''<sup>†</sup>
| ''col20width''   || Twentieth and final column's width (overrides ''colwidth'' above).</tr>
+
::Image to the left of all of the columns.
| ''col20style''  || CSS style/s to apply to the twentieth and final column.</tr>
+
 
| ''col20''        || Twentieth and final column's content.</tr>
+
:;''below''<sup>†</sup>
| ''belowstyle''  || CSS style/s to apply to the ''below'' parameter.</tr>
+
::Text or other elements to appear below the columns.
| ''below''       || Text or other elements to appear below the columns.</tr>
+
 
| ''category''     || The category or categories to which a page including the template will become a member. Avoid using, as such categories not shown in the code of a page transcluding the template.</tr>
+
===Style parameters===
|}
+
:;''bodystyle''<sup>†</sup>
 +
::CSS style/s to apply to the template's body (i.e. including space not used by columns)
 +
 
 +
:;''titlestyle''<sup>†</sup>
 +
::[[Wikipedia:CSS|CSS]] style/s to apply to titlebar; usually <code>background:''color''</code> (background defaults to [[Wikipedia:NavFrame|NavHead]] default).
 +
 
 +
:;''abovestyle''<sup>†</sup>
 +
:;''belowstyle''<sup>†</sup>
 +
::CSS style/s to apply to the ''above'' and ''below'' parameters, respectively.
 +
 
 +
:;''basestyle''<sup>†</sup>
 +
::CSS style/s to apply to the ''title'', ''above'', ''below'', and ''group'' parameters, all at the same time.
 +
 
 +
:;''imagestyle''<sup>†</sup>
 +
::CSS style/s to apply to the ''image'' parameter.
 +
 
 +
:;''imageleftstyle''<sup>†</sup>
 +
::CSS style/s to apply to the ''imageleft'' parameter
 +
 
 +
:;''colsstyle''
 +
::CSS style/s to apply across all columns; if used, usually <code>background:''color''</code> per ''titlestyle'' above.
 +
 
 +
:;''oddcolstyle''
 +
:;''evencolstyle''
 +
::CSS style/s to apply to all odd/even-numbered columns, respectively.
 +
 
 +
:;''col<sub>n</sub>style''
 +
::CSS style/s to apply to the n<sup>th</sup> column only.
 +
 
 +
:;''colheaderstyle''
 +
::CSS style/s to apply to all column headers.
 +
 
 +
:;''colheader2style''
 +
::CSS style/s to apply to all second level columns headers.
 +
 
 +
:;''col<sub>n</sub>headerstyle''
 +
::CSS style/s to apply to the n<sup>th</sup> column header.
 +
 
 +
:;''col<sub>n</sub>headerstyle2''
 +
::CSS style/s to apply to the n<sup>th</sup> second level column header.
 +
 
 +
:;''col<sub>n</sub>footer''
 +
::CSS style/s to apply to the n<sup>th</sup> column footer cell.
 +
 
 +
===Columns parameters===
 +
:;''colwidth''
 +
::Width, preferably in a proportional unit such as '[[Em (typography)|em]]', or as a percentage, used for each column whose width not specified by ''colNwidth'' below. Defaults to 10em. Examples:
 +
:::<code>colwidth = 15em</code>
 +
:::<code>colwidth = 25%</code>
 +
 
 +
:;''padding''
 +
::Padding before first column, preferably in a proportional unit. Defaults to 5em.  Padding is disabled by setting it to 0 (or 0em, or 0%).
 +
 
 +
:;''col<sub>n</sub>width''
 +
::The n<sup>th</sup> column's width (overrides ''colwidth'' above).
 +
 
 +
:;'''''col<sub>n</sub>'''''
 +
::The content of the n<sup>th</sup> column. <code>col1</code> is required.  There can be a maximum of 12 columns.
 +
 
 +
:;''col<sub>n</sub>header''
 +
::A header cell for the n<sup>th</sup> column that appears above the column.
 +
 
 +
:;''col<sub>n</sub>header2
 +
::A second header cell for the n<sup>th</sup> column that appears above the column, but below the first header cell.
 +
 
 +
:;''col<sub>n</sub>footer
 +
::A footer cell that appears below the n<sup>th</sup> column.
 +
 
 +
===Customization parameters for the column headers and footer===
 +
:;''col<sub>n</sub>headercolspan
 +
::A number specifying how many columns the n<sup>th</sup> column header should span.  It defaults to 1.  If it is greater than one, then do not specify column headers that it covers. For example, if <code>col1headercolspan = 3</code>, then leave <code>col2header</code> and <code>col3header</code> blank.
 +
 
 +
:;''col<sub>n</sub>headerrowspan
 +
::Set to either 1 or 2; defaults to 1.  The number of rows that the n<sup>th</sup> column header should span.  Only set to two if you intend to set colNheader2 for the remaining columns.
 +
 
 +
:;''col<sub>n</sub>header2colspan
 +
::A number specifying how many columns the n<sup>th</sup> second level column header should span.  It defaults to 1.  If it is greater than one, then do not specify column headers that it covers. For example, if <code>col1header2colspan = 3</code>, then leave <code>col2header2</code> and <code>col3header3</code> blank.
 +
 
 +
:;''col<sub>n</sub>footercolspan
 +
::A number specifying how many columns the n<sup>th</sup> column footer should span.  It defaults to 1.  If it is greater than one, then do not specify column footers that it covers. For example, if <code>col1footerspan = 3</code>, then leave <code>col2footer</code> and <code>col3footer</code> blank.
 +
 
 +
===Additional groups/lists===
 +
You may wish to add a few extra lists below the columns.  The following parameters are given to provide such functionality.  See {{t1|Navbox}} for a more complete description of how they work, and for more examples.  Groups are not allowed.
 +
 
 +
:;''list<sub>n''
 +
::Allows up to 6 additional lists below the columns.
 +
 
 +
:;''liststyle''
 +
::The general CSS style/s for the lists.
 +
 
 +
:;''list<sub>n</sub>style''
 +
::CSS style/s for the n<sup>th</sup> list parameter.
  
 
== Example ==
 
== Example ==

Revision as of 08:07, 2 May 2008

Template:Template doc page viewed directly A navigation box that presents its content in columns. Originally intended to provide a relatively straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles.

Basic syntax

Only required parameters and colwidth included.

{{Navbox with columns
|name  = {{subst:PAGENAME}}
|title = 
|colwidth =  <!--(to set a default width for each column,
                  preferably in a proportional unit such as 'em'*)-->
|col1  = 
|col2  = 
}}
* See Em (typography). Using proportional units means the template should still be displayed correctly across a range of browser font-sizes. If colwidth not specified, a default 10em is used.

Parameters

Required parameters in bold. Parameters marked with a cross are parameters in common with the sister template {{Navbox}}. A much more complete description of those parameters is available there.

Setup parameters

name
The name of the template. The name of this template, for example, is "Navigation with columns".
state
Possible values are collapsed, uncollapsed, plain, off, and the default autocollapse.
navbar
Possible values are plain, off, and the default value of blank.
border
Possible values are child, none, and the default value of blank.

Basic data parameters

title
The title of the template, displayed centered in the titlebar at the top of the template.
above
Text or other elements to appear above the columns.
image
Image to the right of all of the columns.
imageleft
Image to the left of all of the columns.
below
Text or other elements to appear below the columns.

Style parameters

bodystyle
CSS style/s to apply to the template's body (i.e. including space not used by columns)
titlestyle
CSS style/s to apply to titlebar; usually background:color (background defaults to NavHead default).
abovestyle
belowstyle
CSS style/s to apply to the above and below parameters, respectively.
basestyle
CSS style/s to apply to the title, above, below, and group parameters, all at the same time.
imagestyle
CSS style/s to apply to the image parameter.
imageleftstyle
CSS style/s to apply to the imageleft parameter
colsstyle
CSS style/s to apply across all columns; if used, usually background:color per titlestyle above.
oddcolstyle
evencolstyle
CSS style/s to apply to all odd/even-numbered columns, respectively.
colnstyle
CSS style/s to apply to the nth column only.
colheaderstyle
CSS style/s to apply to all column headers.
colheader2style
CSS style/s to apply to all second level columns headers.
colnheaderstyle
CSS style/s to apply to the nth column header.
colnheaderstyle2
CSS style/s to apply to the nth second level column header.
colnfooter
CSS style/s to apply to the nth column footer cell.

Columns parameters

colwidth
Width, preferably in a proportional unit such as 'em', or as a percentage, used for each column whose width not specified by colNwidth below. Defaults to 10em. Examples:
colwidth = 15em
colwidth = 25%
padding
Padding before first column, preferably in a proportional unit. Defaults to 5em. Padding is disabled by setting it to 0 (or 0em, or 0%).
colnwidth
The nth column's width (overrides colwidth above).
coln
The content of the nth column. col1 is required. There can be a maximum of 12 columns.
colnheader
A header cell for the nth column that appears above the column.
colnheader2
A second header cell for the nth column that appears above the column, but below the first header cell.
colnfooter
A footer cell that appears below the nth column.

Customization parameters for the column headers and footer

colnheadercolspan
A number specifying how many columns the nth column header should span. It defaults to 1. If it is greater than one, then do not specify column headers that it covers. For example, if col1headercolspan = 3, then leave col2header and col3header blank.
colnheaderrowspan
Set to either 1 or 2; defaults to 1. The number of rows that the nth column header should span. Only set to two if you intend to set colNheader2 for the remaining columns.
colnheader2colspan
A number specifying how many columns the nth second level column header should span. It defaults to 1. If it is greater than one, then do not specify column headers that it covers. For example, if col1header2colspan = 3, then leave col2header2 and col3header3 blank.
colnfootercolspan
A number specifying how many columns the nth column footer should span. It defaults to 1. If it is greater than one, then do not specify column footers that it covers. For example, if col1footerspan = 3, then leave col2footer and col3footer blank.

Additional groups/lists

You may wish to add a few extra lists below the columns. The following parameters are given to provide such functionality. See {{Navbox}} for a more complete description of how they work, and for more examples. Groups are not allowed.

listn
Allows up to 6 additional lists below the columns.
liststyle
The general CSS style/s for the lists.
listnstyle
CSS style/s for the nth list parameter.

Example

Code

{{Navbox with columns
|name    = East Asia Summit (EAS)
|title   = Member states of the [[East Asia Summit|East Asia Summit (EAS)]]
|width   = 18.25em
|padding = 10em

|above = ''This is where the {{{above}}} would appear.''

|col1 = {{AUS}}<br/> {{BRU}}<br/> {{CAM}}<br/> {{IND}}
|col2 = {{IDN}}<br/> {{JPN}}<br/> {{LAO}}<br/> {{MAS}}
|col3 = {{MYA}}<br/> {{NZL}}<br/> {{CHN-PRC}}<br/> {{PHI}}
|col4width=17em
|col4 = {{SIN}}<br/> {{KOR}}<br/> {{THA}}<br/> {{VIE}}

|below = '''Potential future members'''{{spaces|6}}{{TLS}}{{spaces|3}}{{RUS}}
}}

Result

See also

Template:Navigational templates