Template:Infobox style: Difference between revisions
RaiderAlpha (talk | contribs) Created page with "<includeonly>{{#switch:{{{1|}}} |main_box= class="infobox {{#if:{{{2|}}}|{{{2}}}}}" style="background: #0f161c; width:{{#if:{{{width|}}}|{{{width}}}|300px}}; border-spacing: 2..." |
RaiderAlpha (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<includeonly>{{#switch:{{{ | <includeonly>{{#switch:{{{2|}}} | ||
| | |||
| | |gdi = {{#switch:{{{1|}}} | ||
| | |infobox = width: 300px; | ||
| | |infobox_title = background: #e2c14e; color: #000; | ||
| | |infobox_header = background: #e2c14e; color: #000; | ||
| | |infobox_label = background: #e2c14e; color: #000; | ||
|infobox_label= | |infobox_data = background: #e2c14e; color: #000; | ||
|infobox_data= | }} | ||
| | |||
| | |nod = {{#switch:{{{1|}}} | ||
| | |infobox = width: 300px; | ||
| | |infobox_title = background: #9d1313; color: #fff; | ||
| | |infobox_header = background: #9d1313; color: #fff; | ||
| | |infobox_label = background: #9d1313; color: #fff; | ||
|infobox_data = color: #000; | |||
}} | |||
| | |#default = {{#switch:{{{1|}}} | ||
|infobox = width: 300px; | |||
|infobox_title = background: #0c2e3f; color: #fff; | |||
|infobox_header = background: #0c2e3f; color: #fff; | |||
|infobox_label = background: #0c2e3f; color: #fff; | |||
|infobox_data = color: #000; | |||
}} | |||
}}</includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude> | }}</includeonly><noinclude>{{Documentation}}[[Category:Templates]]</noinclude> |
Revision as of 17:32, 8 September 2020
The various primary and auxiliary infobox templates and navigation templates maintained by the Military history WikiProject are all coded to use a common set of styling characteristics. This is needed primarily because a number of the templates are designed to be stacked together to present the appearance of a continuous block; it is also beneficial for providing a consistent appearance to the entire set of articles within our scope.
The style is controlled by the Infobox style template, which generates a number of different codes based on the parameter passed to it.
- {{Infobox style|main_box}} – produces the CSS class and style parameters for an infobox at a width of 315 pixels.
- {{Infobox style|main_box_raw}} – produces the raw CSS style parameters for an infobox at a width of 315 pixels.
- {{Infobox style|main_box_raw_auto_width}} – produces the raw CSS style parameters for an infobox (same as main_box_raw but without width:315px).
- {{Infobox style|header_bar}} – produces the CSS style parameters for a horizontal header bar in an infobox.
- {{Infobox style|header_raw}} – produces the raw CSS style parameters for a horizontal header bar in an infobox.
- {{Infobox style|header_color}} – produces the raw CSS style color attributes for a horizontal header bar in an infobox.
- {{Infobox style|sub_header_bar}} – produces the CSS style parameters for a horizontal sub-header bar in an infobox.
- {{Infobox style|sub_header_raw}} – produces the raw CSS style parameters for a horizontal sub-header bar in an infobox.
- {{Infobox style|image_box}} – produces the CSS style parameters for a standard image & caption block with a bottom border.
- {{Infobox style|image_box_raw}} – produces the raw CSS style parameters for a standard image & caption block with a bottom border.
- {{Infobox style|image_box_plain}} – produces the CSS style parameters for a standard image & caption block without a bottom border; this is typically used when the image block is placed immediately above a header bar, or at the bottom of the infobox.
- {{Infobox style|image_box_plain_raw}} – produces the raw CSS style parameters for a standard image & caption block without a bottom border; this is typically used when the image block is placed immediately above a header bar, or at the bottom of the infobox.
- {{Infobox style|internal_border}} – produces the raw CSS style attributes for a border between parts of the same infobox section.
- {{Infobox style|section_border}} – produces the raw CSS style attributes for a border between different infobox sections.
- {{Infobox style|nav_box}} – produces the raw CSS style attributes for a collapsible navigation template at a width of 315 pixels.
- {{Infobox style|nav_box_child}} – produces the raw CSS style attributes for a collapsible navigation template (same as nav_box but at a width of 305 pixels and without margin-left:1em).
- {{Infobox style|nav_box_wide}} – produces the raw CSS style attributes for a full-width collapsible navigation template.
- {{Infobox style|nav_box_header}} – produces the raw CSS style attributes for the header bar in a collapsible navigation template.
- {{Infobox style|nav_box_wide_header}} – produces the raw CSS style attributes for the header bar in a full-width collapsible navigation template.
- {{Infobox style|nav_box_label}} – produces the raw CSS style attributes for a row label in a collapsible navigation template.
A sample template using some of these options can be seen at right. From the top, it includes:
- The main header_bar in a table heading cell.
- A sub_header_bar in a normal table cell.
- An image_box.
- Two normal fields with labels.
- A secondary header_bar in a heading cell.
- A pair of cells divided by an internal_border.
- A cell with a section_border at the top.
- Another secondary header_bar in a heading cell.
- An image_box_plain.
More sophisticated samples of the code can be found by examining the actual infoboxes used by the project.
The above documentation is transcluded from Template:Infobox style/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |