Template:California topic

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Documentation icon Template documentation[view] [edit] [history] [purge]

Usage[edit]

1st parameter (prefix)[edit]

The most basic usage of template is with a single unnamed parameter in the format {{Continent/region topic|Topic [of/in]}}, replacing Continent/region with the name of a continent or region and Topic with the name of a topic followed by "of" or "in". For example, {{Africa topic|Geography of}} generates a navigation box titled "Geography of Africa" with a list of country names linked to articles such as Geography of Angola, etc.

Code
{{California topic|History of}}
Result


The named parameter prefix can be used in place of the unnamed 1st parameter.

Code
{{California topic|prefix=Culture of}}
Result


2nd parameter (suffix)[edit]

The template accepts a second unnamed parameter for text to be placed after the country name. There is no space between the country name and the suffix, to allow for links to articles such as List of California-related topics.

Code
{{California topic|| in popular culture}}
Result

Parameters[edit]

Mandatory[edit]

name
Mandatory when creating a new template (i.e. Template:Hospitals in the United States), otherwise the "view · talk · edit" links will connect to Template:United States topic. You can enter {{subst:PAGENAME}} for this value as a shortcut.

One of the following combinations is needed to create the links:

prefix
Text to be placed before the U.S. state name. The prefix text is always followed by a space. For example: prefix = List of airports in would create a title List of airports in the United States and a body containing state names linked to List of airports in Alabama, List of airports in Alaska, etc.
Note: In instances when only prefix is specified, the template inserts "the" between the prefix text and "United States", creating the title List of airports in the United States instead of List of airports in United States. In the body it does the same for the Northern Mariana Islands and the United States Virgin Islands.
suffix
Places text after the U.S. state name. For example: suffix = _National Guard would create a title United States National Guard and a body containing state names linked to Alabama National Guard, Arizona National Guard, etc.
Note: An underscore is used in place of the leading space in the suffix. This is done to allow the use of suffixes without a leading space, as in the following example. A title should be specified to avoid the underscore appearing in the title.
prefix and suffix
Places text before and after the U.S. state name. For example: prefix = Index of and suffix = -related articles would create a title Index of United States-related articles and a body containing state names linked to Index of Alabama-related articles, Index of Alaska-related articles, etc.

Optional[edit]

state
A navbox with autocollapse will start out collapsed if there are two or more tables on the same page that use collapsible. If set to collapsed, the navbox will always start out in a collapsed state. If set to blank or anything other than autocollapse or collapsed, the navbox will always start out in an expanded state.
Default is: autocollapse.
title
Text that appears centered in the titlebar (the top bar). This is optional because the use of either prefix, suffix or both will automatically generate a title if the title parameter is not supplied. This parameter is not automatically wiki-linked. For example: title = [[List of rivers of the United States|Rivers in the United States]] generates the title Rivers in the United States.

Excluding groups[edit]

In some instances the District of Columbia, U.S. Territories (Insular Areas) or U.S. Minor Outlying Islands may not be relevant to or have their own articles on a particular topic. To disable their inclusion in the template and avoid unnecessary red links, add any or all of the following parameters:

exclude-regions
Set to any value this excludes display of the group named "Regions" which links to San Fernando Valley, etc.
exclude-counties
Set to any value this excludes display of the group named "Counties" which links to Los Angeles County, California, Sacramento County, California, etc.
exclude-cities
Set to any value this excludes display of the group named "Cities and towns" which links to various cities and towns.
exclude-suffix
Set to any value this excludes the use of ", California" in links.

Adding groups and lists[edit]

Some templates may require a list of links not already included in the template. These can be specified as follows:

above
A full-width cell (no group header) displayed above the template's body (between the title and U.S. state links).
list1
Text or a list of links that is displayed above the region, county, and city links, but below the above section.
group1
Header text displayed in cell to left of text specified in list1.
list5
Text or a list of links that is displayed below the region, county, and city links, but above the below section.
group5
Header text displayed in cell to left of text specified in list5.
below
A full-width cell (no group header) displayed below the template's body.

Styles[edit]

titlestyle
Specifies CSS values to apply to the title. One use of this is to set the background color of the title:
titlestyle = background: #0000FF;
titlestyle = background: blue;
Default is: background: #ccccff;
bodystyle
Specifies CSS values to apply to the entire template. This will not override the following {{Navbox}} default styles:
abovestyle = background:#ddddff;
belowstyle = background:#ddddff;
groupstyle = background:#ddddff; text-align:right; white-space:nowrap;
liststyle = width:100%; font-size:95%;
abovestyle
belowstyle
Specifies CSS values to apply to the cell specified via the above and below parameters. For instance:
belowstyle = border-top: #ccccff 1px solid;
Default is: background: #ddddff;
groupstyle
Specifies CSS values to apply to the cells specified via the groupn cells. This option overrides any styles that are applied to the entire table. Example:
groupstyle = background:#6AFB92; vertical-align:top;
Default is: background: #ddddff; text-align:right; white-space:nowrap;
liststyle
Specifies CSS values to apply to the cells specified via the listn cells. This option overrides any styles that are applied to the entire table. Examples:
liststyle = padding: 5px 10px 5px 10px;
Default is: width:100%; font-size:95%;