(Use ACE Editor recognized tabs | note that <navigation> does not display in horizontal groups | use WP style reference placement) Tag: Help |
Rail (Message Wall | contribs) (remove nowiki tags in favor to simple escaping) Tag: Help |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 3: | Line 3: | ||
All infobox fields should be declared using [[Wikipedia:XML|XML]] convention, with [[Wikipedia:HTML attribute|attributes]] used for field configuration.<ref>[[wikibooks:XML - Managing Data Exchange/A single entity#Introduction|Wikibooks xml introduction]]</ref> |
All infobox fields should be declared using [[Wikipedia:XML|XML]] convention, with [[Wikipedia:HTML attribute|attributes]] used for field configuration.<ref>[[wikibooks:XML - Managing Data Exchange/A single entity#Introduction|Wikibooks xml introduction]]</ref> |
||
− | ==<code> |
+ | ==<code><infobox></code>== |
− | The <code> |
+ | The <code><infobox></code> tag holds all others and delimits the scope of the infobox. |
===Valid tags=== |
===Valid tags=== |
||
Line 14: | Line 14: | ||
| None |
| None |
||
| |
| |
||
− | * <code> |
+ | * <code><title></code> |
− | * <code> |
+ | * <code><image></code> |
− | * <code> |
+ | * <code><header></code> |
− | * <code> |
+ | * <code><navigation></code> |
− | * <code> |
+ | * <code><data></code> |
− | * <code> |
+ | * <code><group></code> |
+ | * <code><panel></code> |
||
|} |
|} |
||
===Attributes=== |
===Attributes=== |
||
; <code>theme</code> |
; <code>theme</code> |
||
− | : The name of the theme to apply. |
+ | : The name of the theme to apply. Adds a class to the infobox of the form <code>.pi-theme-$1</code>, with spaces transformed into hyphens (-). Does not overwrite <code>theme-source</code> or <code>type</code>. |
; <code>theme-source</code> |
; <code>theme-source</code> |
||
− | : The name of the parameter to use as a theme. Does not overwrite <code>theme</code>. |
+ | : The name of the parameter to use as a theme. Adds a class to the infobox of the form <code>.pi-theme-$1</code>, with spaces transformed into hyphens (-). Does not overwrite <code>theme</code> or <code>type</code>. |
− | ; <code> |
+ | ; <code>type</code> |
+ | : The name of the type to apply. Adds a class to the infobox of the form <code>.type-$1</code>, with spaces transformed into hyphens (-). Does not overwrite <code>theme</code> or <code>theme-source</code>. |
||
⚫ | |||
; <code>accent-color-source</code> |
; <code>accent-color-source</code> |
||
: The name of the parameter to use as an accent color. |
: The name of the parameter to use as an accent color. |
||
⚫ | |||
⚫ | |||
; <code>accent-color-default</code> |
; <code>accent-color-default</code> |
||
: The default accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g. <code><nowiki>#f00</nowiki></code> or <code><nowiki>#ff0000</nowiki></code>. |
: The default accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g. <code><nowiki>#f00</nowiki></code> or <code><nowiki>#ff0000</nowiki></code>. |
||
⚫ | |||
⚫ | |||
; <code>accent-color-text-default</code> |
; <code>accent-color-text-default</code> |
||
: The default text accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g. <code><nowiki>#f00</nowiki></code> or <code><nowiki>#ff0000</nowiki></code>. |
: The default text accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g. <code><nowiki>#f00</nowiki></code> or <code><nowiki>#ff0000</nowiki></code>. |
||
+ | ; <code>layout</code> |
||
⚫ | |||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 49: | Line 54: | ||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
<aside class="portable-infobox pi-background pi-theme-wikia pi-layout-default"> |
<aside class="portable-infobox pi-background pi-theme-wikia pi-layout-default"> |
||
− | <h2 class="pi-item pi-item-spacing pi-title">Title</h2> |
+ | <h2 class="pi-item pi-item-spacing pi-title" data-source="title_source">Title</h2> |
</aside> |
</aside> |
||
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><title></code>== |
− | The <code> |
+ | The <code><title></code> tag states infobox title. Images used in <code><title></code> tags do not appear on mobile.<ref>[[w:c:p:Thread:3033#15|Portability Hub Office Hours, 2015-11-26]]</ref> |
===Valid tags=== |
===Valid tags=== |
||
Line 64: | Line 69: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> |
| |
| |
||
− | * <code> |
+ | * <code><default></code> |
− | * <code> |
+ | * <code><format></code> |
|} |
|} |
||
Line 74: | Line 79: | ||
; <code>source</code> |
; <code>source</code> |
||
: The name of the parameter to use. |
: The name of the parameter to use. |
||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 85: | Line 92: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <h2 class="pi-item pi-item-spacing pi-title">Page name</h2> |
+ | <h2 class="pi-item pi-item-spacing pi-title" data-source="title_source">Page name</h2> |
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><data></code>== |
− | The <code> |
+ | The <code><data></code> tag is the standard key-value tag. |
===Valid tags=== |
===Valid tags=== |
||
Line 99: | Line 106: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> |
| |
| |
||
− | * <code> |
+ | * <code><default></code> |
− | * <code> |
+ | * <code><label></code> |
− | * <code> |
+ | * <code><format></code> |
|} |
|} |
||
Line 114: | Line 121: | ||
; <code>layout</code> |
; <code>layout</code> |
||
: Possible values: <code>default</code>. Only available in smart groups. |
: Possible values: <code>default</code>. Only available in smart groups. |
||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 126: | Line 135: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <div class="pi-item pi-item-spacing |
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="name"> |
− | <h3 class="pi- |
+ | <h3 class="pi-data-label pi-secondary-font">First name</h3> |
− | <div class=" |
+ | <div class="pi-data-value pi-font">John</div> |
</div> |
</div> |
||
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><label></code>== |
− | The <code> |
+ | The <code><label></code> tag can be used only inside other tags, check child tags column for more info. Accepts '''wikitext'''. |
===Valid tags=== |
===Valid tags=== |
||
Line 143: | Line 152: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><data></code> |
+ | * <code><section></code> |
||
| None |
| None |
||
|} |
|} |
||
Line 158: | Line 168: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <h3 class="pi- |
+ | <h3 class="pi-data-label pi-secondary-font">First name</h3> |
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><default></code>== |
− | The <code> |
+ | The <code><default></code> tag text is used when "<code>source</code>" data is not specified, can be used only inside other tags, check child tags column for more info. Accepts '''wikitext'''. |
===Valid tags=== |
===Valid tags=== |
||
Line 172: | Line 182: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><title></code> |
− | * <code> |
+ | * <code><data></code> |
− | * <code> |
+ | * <code><image></code> |
− | * <code> |
+ | * <code><alt></code> |
− | * <code> |
+ | * <code><caption></code> |
| None |
| None |
||
|} |
|} |
||
Line 191: | Line 201: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <div class=" |
+ | <div class="pi-data-value pi-font">John</div> |
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><format></code>== |
− | The <code> |
+ | The <code><format></code> tag can be used only inside other tags, check child tags column for more info. Accepts '''[[Help:Wikitext|wikitext]]'''. |
===Valid tags=== |
===Valid tags=== |
||
Line 205: | Line 215: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><title></code> |
− | * <code> |
+ | * <code><data></code> |
− | * <code> |
+ | * <code><caption></code> |
| None |
| None |
||
|} |
|} |
||
Line 225: | Line 235: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <div class="pi-item pi-item-spacing |
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="dollars"> |
− | <h3 class="pi- |
+ | <h3 class="pi-data-label pi-secondary-font">Regular price</h3> |
− | <div class=" |
+ | <div class="pi-data-value pi-font">$15</div> |
</div> |
</div> |
||
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><image></code>== |
− | The <code> |
+ | The <code><image></code> tag is used to insert images or video inside an infobox. It can only be styled using the community's [[Help:Community CSS and JS|CSS]], and cannot be manually resized. Images are normalized, such that <code><nowiki>[[File:Example.jpg]]</nowiki></code> and <code>Example.jpg</code> do the same thing. Multiple images can be passed by [[w:Thread:935527|using a <code><gallery></code> tag]]. |
− | Here, the default tag is used to specify an image to be used when no image has been chosen on an article. For example, <code> |
+ | Here, the <code><default></code> tag is used to specify an image to be used when no image has been chosen on an article. For example, <code><default>Example.jpg</default></code>. |
===Valid tags=== |
===Valid tags=== |
||
Line 244: | Line 254: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> |
| |
| |
||
− | * <code> |
+ | * <code><alt></code> |
− | * <code> |
+ | * <code><caption></code> |
− | * <code> |
+ | * <code><default></code> |
|} |
|} |
||
Line 255: | Line 265: | ||
; <code>source</code> |
; <code>source</code> |
||
: The name of the parameter to use. |
: The name of the parameter to use. |
||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 264: | Line 276: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <figure class="pi-item pi-image"> |
+ | <figure class="pi-item pi-image" data-source="image"> |
<a href=".../File:Image.jpg" class="image image-thumbnail" title=""> |
<a href=".../File:Image.jpg" class="image image-thumbnail" title=""> |
||
− | <img src="Image.jpg" class="pi-image-thumbnail" alt |
+ | <img src="Image.jpg" srcset="Image.jpg 1x, Image.jpg 2x" class="pi-image-thumbnail" alt="" data-image-key="Image.jpg" data-image-name="Image.jpg" width="" height=""> |
</a> |
</a> |
||
</figure> |
</figure> |
||
Line 272: | Line 284: | ||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><alt></code>== |
− | The <code> |
+ | The <code><alt></code> tag can be used only inside <code><image></code> tag. |
===Valid tags=== |
===Valid tags=== |
||
Line 282: | Line 294: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><image></code> |
| |
| |
||
− | * <code> |
+ | * <code><default></code> |
|} |
|} |
||
Line 303: | Line 315: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <figure class="pi-item pi-image"> |
+ | <figure class="pi-item pi-image" data-source="image"> |
<a href=".../File:Image.jpg" class="image image-thumbnail" title="Default alt text"> |
<a href=".../File:Image.jpg" class="image image-thumbnail" title="Default alt text"> |
||
− | <img src="Image.jpg" class="pi-image-thumbnail" alt="Default alt text |
+ | <img src="Image.jpg" srcset="Image.jpg 1x, Image.jpg 2x" class="pi-image-thumbnail" alt="Default alt text" data-image-key="Image.jpg" data-image-name="Image.jpg" width="" height=""> |
</a> |
</a> |
||
</figure> |
</figure> |
||
Line 311: | Line 323: | ||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><caption></code>== |
− | The <code> |
+ | The <code><caption></code> tag can be used only inside <code><image></code> tag. |
===Valid tags=== |
===Valid tags=== |
||
Line 321: | Line 333: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><image></code> |
| |
| |
||
− | * <code> |
+ | * <code><default></code> |
− | * <code> |
+ | * <code><format></code> |
|} |
|} |
||
Line 347: | Line 359: | ||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><group></code>== |
− | The <code> |
+ | The <code><group></code> tag is used for grouping fields, and optionally accepts a header for each group. A group won't be rendered (including any headers) if all fields are empty. However, if the <code>show</code> attribute is set to <code>incomplete</code>, it will render all of the group's fields if at least '''one field''' is not empty. |
===Valid tags=== |
===Valid tags=== |
||
Line 357: | Line 369: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> |
| |
| |
||
− | * <code> |
+ | * <code><data></code> |
− | * <code> |
+ | * <code><header></code> |
− | * <code> |
+ | * <code><image></code> |
− | * <code> |
+ | * <code><title></code> |
− | * <code> |
+ | * <code><group></code> |
− | * <code> |
+ | * <code><navigation></code> |
+ | * <code><panel></code> |
||
|} |
|} |
||
Line 374: | Line 387: | ||
: Possible values: <code>default</code>, <code>incomplete</code>. |
: Possible values: <code>default</code>, <code>incomplete</code>. |
||
; <code>collapse</code> |
; <code>collapse</code> |
||
− | : Possible values: <code>open</code>, <code>closed</code>. Only available if the group's first child is a <code> |
+ | : Possible values: <code>open</code>, <code>closed</code>. Only available if the group's first child is a <code><header></code> tag. |
; <code>row-items</code> |
; <code>row-items</code> |
||
− | : Turns the group into a smart group spanning ''n'' columns. Smart groups arrange their cells (<code> |
+ | : Turns the group into a smart group spanning ''n'' columns. Smart groups arrange their cells (<code><data></code> tags) horizontally, and automatically wrap to a new row once the current one exceeds that limit. Cells are stretched to take up as much space as possible on the last row. |
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 391: | Line 406: | ||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
<section class="pi-item pi-group pi-border-color"> |
<section class="pi-item pi-group pi-border-color"> |
||
− | <h2 class="pi-item pi-secondary-font pi-item-spacing pi-secondary-background |
+ | <h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background">Group name</h2> |
− | <div class="pi-item pi-item-spacing |
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="value1"> |
− | <div class=" |
+ | <div class="pi-data-value pi-font">Data value</div> |
</div> |
</div> |
||
</section> |
</section> |
||
Line 414: | Line 429: | ||
<section class="pi-item pi-group pi-border-color"> |
<section class="pi-item pi-group pi-border-color"> |
||
<table class="pi-horizontal-group"> |
<table class="pi-horizontal-group"> |
||
− | <caption class="pi-secondary-font pi-secondary-background pi-item-spacing |
+ | <caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">Group name</caption> |
<thead> |
<thead> |
||
<tr> |
<tr> |
||
− | <th class=" |
+ | <th class="pi-horizontal-group-item pi-data-label pi-secondary-font pi-border-color pi-item-spacing" data-source="value1">Data label</th> |
</tr> |
</tr> |
||
</thead> |
</thead> |
||
<tbody> |
<tbody> |
||
<tr> |
<tr> |
||
− | <td class=" |
+ | <td class="pi-horizontal-group-item pi-data-value pi-font pi-border-color pi-item-spacing" data-source="value1">Data value</td> |
</tr> |
</tr> |
||
</tbody> |
</tbody> |
||
Line 436: | Line 451: | ||
<group row-items="3"> |
<group row-items="3"> |
||
<header>Section Header</header> |
<header>Section Header</header> |
||
− | <data source=" |
+ | <data source="value 1"> |
− | <label>Label</label> |
+ | <label>Label 1</label> |
</data> |
</data> |
||
− | <data source=" |
+ | <data source="value 2"> |
− | <label>Label</label> |
+ | <label>Label 2</label> |
</data> |
</data> |
||
− | <data source=" |
+ | <data source="value 3"> |
− | <label>Label</label> |
+ | <label>Label 3</label> |
</data> |
</data> |
||
− | <data source=" |
+ | <data source="value 4" layout="default"> |
− | <label>Label</label> |
+ | <label>Label 4</label> |
</data> |
</data> |
||
− | <data source=" |
+ | <data source="value 5"> |
− | <label>Label</label> |
+ | <label>Label 5</label> |
</data> |
</data> |
||
− | <data source=" |
+ | <data source="value 6"> |
− | <label>Label</label> |
+ | <label>Label 6</label> |
⚫ | |||
⚫ | |||
⚫ | |||
</data> |
</data> |
||
</group> |
</group> |
||
Line 465: | Line 477: | ||
<section class="pi-item pi-smart-group pi-border-color"> |
<section class="pi-item pi-smart-group pi-border-color"> |
||
<section class="pi-smart-group-head"> |
<section class="pi-smart-group-head"> |
||
− | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);">Label</h3> |
+ | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 1">Label 1</h3> |
− | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);">Label</h3> |
+ | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 2">Label 2</h3> |
− | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);">Label</h3> |
+ | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 3">Label 3</h3> |
</section> |
</section> |
||
<section class="pi-smart-group-body"> |
<section class="pi-smart-group-body"> |
||
− | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);"> |
+ | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 1">AAA</div> |
− | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);"> |
+ | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 2">BBB</div> |
− | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);"> |
+ | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 3">CCC</div> |
</section> |
</section> |
||
</section> |
</section> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<section class="pi-item pi-smart-group pi-border-color"> |
<section class="pi-item pi-smart-group pi-border-color"> |
||
<section class="pi-smart-group-head"> |
<section class="pi-smart-group-head"> |
||
− | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);">Label</h3> |
+ | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 5">Label 5</h3> |
− | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);">Label</h3> |
+ | <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 6">Label 6</h3> |
</section> |
</section> |
||
<section class="pi-smart-group-body"> |
<section class="pi-smart-group-body"> |
||
− | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);"> |
+ | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 5">EEE</div> |
− | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);"> |
+ | <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 6">FFF</div> |
</section> |
</section> |
||
</section> |
</section> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</section> |
</section> |
||
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><header></code>== |
− | The <code> |
+ | The <code><header></code> tag denotes the beginning of a section or group of tags. |
===Valid tags=== |
===Valid tags=== |
||
Line 507: | Line 515: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> |
+ | * <code><panel></code> |
||
| None |
| None |
||
|} |
|} |
||
===Attributes=== |
===Attributes=== |
||
+ | ; <code>name</code> |
||
− | None. |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 523: | Line 533: | ||
{{term|1=Default group output}} |
{{term|1=Default group output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <h2 class="pi-item pi-secondary-font pi-item-spacing pi-secondary-background |
+ | <h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background">Header Text</h2> |
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{term|1=Horizontal group output}} |
{{term|1=Horizontal group output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <caption class="pi-secondary-font pi-secondary-background pi-item-spacing |
+ | <caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">Header Text</caption> |
</syntaxhighlight>}} |
</syntaxhighlight>}} |
||
{{glossary end}} |
{{glossary end}} |
||
− | ==<code> |
+ | ==<code><navigation></code>== |
− | The <code> |
+ | The <code><navigation></code> tag is used for providing any '''wikitext'''. |
===Valid tags=== |
===Valid tags=== |
||
Line 541: | Line 551: | ||
|- |
|- |
||
| |
| |
||
− | * <code> |
+ | * <code><infobox></code> |
− | * <code> |
+ | * <code><group></code> (not available in [[#Horizontal group|horizontal groups]]) |
| None |
| None |
||
|} |
|} |
||
===Attributes=== |
===Attributes=== |
||
+ | ; <code>name</code> |
||
− | None. |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
===HTML output=== |
===HTML output=== |
||
Line 557: | Line 568: | ||
{{term|1=Output}} |
{{term|1=Output}} |
||
{{defn|1=<syntaxhighlight lang="html5"> |
{{defn|1=<syntaxhighlight lang="html5"> |
||
− | <nav class="pi-item-spacing pi-secondary-background pi-secondary-font |
+ | <nav class="pi-navigation pi-item-spacing pi-secondary-background pi-secondary-font"> |
<a href="/wiki/Link" title="Link">Link</a> |
<a href="/wiki/Link" title="Link">Link</a> |
||
</nav> |
</nav> |
||
Line 563: | Line 574: | ||
{{glossary end}} |
{{glossary end}} |
||
+ | ==<code><panel></code>== |
||
⚫ | |||
+ | The <code><panel></code> tag is used to create tabbed interfaces, where the contents of each tab is wrapped in a <code><section></code> tag. |
||
− | {{Reflist}} |
||
+ | ===Valid tags=== |
||
⚫ | |||
+ | {|class="article-table" style="table-layout: fixed; width: 100%;" |
||
+ | |- |
||
+ | !scope="col"| Parent tags |
||
+ | !scope="col"| Child tags |
||
+ | |- |
||
+ | | |
||
+ | * <code><infobox></code> |
||
+ | * <code><group></code> |
||
+ | | |
||
+ | * <code><header></code> |
||
+ | * <code><section></code> |
||
+ | |} |
||
+ | |||
+ | ===Attributes=== |
||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
+ | |||
+ | ===HTML output=== |
||
+ | {{glossary}} |
||
+ | {{term|1=Input}} |
||
+ | {{defn|1=<syntaxhighlight lang="xml"> |
||
+ | <panel> |
||
+ | <section> |
||
⚫ | |||
+ | <data source="one" /> |
||
+ | <data source="two" /> |
||
+ | </section> |
||
+ | <section> |
||
+ | <label>B</label> |
||
+ | <data source="three" /> |
||
+ | <data source="four" /> |
||
+ | </section> |
||
+ | </panel> |
||
+ | </syntaxhighlight>}} |
||
+ | {{term|1=Output}} |
||
+ | {{defn|1=<syntaxhighlight lang="html5"> |
||
+ | <section class="pi-item pi-panel pi-border-color"> |
||
+ | <div class="pi-panel-scroll-wrapper"> |
||
+ | <ul class="pi-section-navigation"> |
||
+ | <li class="pi-section-tab pi-section-active" data-ref="0"> |
||
+ | <div class="pi-section-label">A</div> |
||
+ | </li> |
||
+ | <li class="pi-section-tab" data-ref="1"> |
||
+ | <div class="pi-section-label">B</div> |
||
+ | </li> |
||
+ | </ul> |
||
⚫ | |||
+ | <div class="pi-section-contents"> |
||
+ | <div class="pi-section-content pi-section-active" data-ref="0"> |
||
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="one"> |
||
+ | <div class="pi-data-value pi-font">1st</div> |
||
+ | </div> |
||
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="two"> |
||
+ | <div class="pi-data-value pi-font">2nd</div> |
||
+ | </div> |
||
+ | </div> |
||
+ | <div class="pi-section-content" data-ref="1"> |
||
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="three"> |
||
+ | <div class="pi-data-value pi-font">3rd</div> |
||
+ | </div> |
||
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="four"> |
||
+ | <div class="pi-data-value pi-font">4th</div> |
||
+ | </div> |
||
+ | </div> |
||
⚫ | |||
+ | </section> |
||
+ | </syntaxhighlight>}} |
||
+ | {{glossary end}} |
||
+ | |||
+ | ==<code><section></code>== |
||
+ | The <code><section></code> tag represents the contents of a tab. The clickable toggle is represented by a <code><label></code> tag. Labels default to their zero-based index if omitted; if all tabs within a panel are unlabeled, then they are stacked vertically. |
||
+ | |||
+ | ===Valid tags=== |
||
+ | {|class="article-table" style="table-layout: fixed; width: 100%;" |
||
+ | |- |
||
+ | !scope="col"| Parent tags |
||
+ | !scope="col"| Child tags |
||
+ | |- |
||
+ | | |
||
+ | * <code><panel></code> |
||
+ | | |
||
+ | * <code><title></code> |
||
+ | * <code><data></code> |
||
+ | * <code><label></code> |
||
+ | * <code><image></code> |
||
+ | * <code><group></code> |
||
+ | * <code><header></code> |
||
+ | * <code><navigation></code> |
||
+ | |} |
||
+ | |||
+ | ===Attributes=== |
||
+ | ; <code>name</code> |
||
+ | : Internal name for the element and its children. Assigned to the <code>data-item-name</code> attribute in the resulting HTML. |
||
+ | |||
+ | ===HTML output=== |
||
+ | {{glossary}} |
||
+ | {{term|1=Input}} |
||
+ | {{defn|1=<syntaxhighlight lang="xml"> |
||
+ | <section> |
||
+ | <label>A</label> |
||
⚫ | |||
+ | <data source="two" /> |
||
+ | </section> |
||
+ | </syntaxhighlight>}} |
||
+ | {{term|1=Output}} |
||
+ | {{defn|1=<syntaxhighlight lang="html5"> |
||
+ | <div class="pi-section-content" data-ref="0"> |
||
⚫ | |||
⚫ | |||
+ | </div> |
||
+ | <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="two"> |
||
⚫ | |||
+ | </div> |
||
+ | </div> |
||
+ | </syntaxhighlight>}} |
||
+ | {{glossary end}} |
||
+ | |||
⚫ | |||
⚫ | |||
[[es:Ayuda:Infoboxes/Etiquetas]] |
[[es:Ayuda:Infoboxes/Etiquetas]] |
||
[[fi:Ohje:Tietolaatikot/Tunnisteet]] |
[[fi:Ohje:Tietolaatikot/Tunnisteet]] |
||
Line 576: | Line 706: | ||
[[pt:Ajuda:Infoboxes/Tags]] |
[[pt:Ajuda:Infoboxes/Tags]] |
||
[[ru:Справка:Инфобоксы/теги]] |
[[ru:Справка:Инфобоксы/теги]] |
||
+ | [[tr:Yardım:Bilgi kutuları/Etiketler]] |
||
[[uk:Довідка:Інфобокси/теґи]] |
[[uk:Довідка:Інфобокси/теґи]] |
||
[[vi:Trợ giúp:Hộp thông tin/Các thẻ]] |
[[vi:Trợ giúp:Hộp thông tin/Các thẻ]] |
Revision as of 08:44, 12 June 2020
Portable infoboxes include a wide variety of tags and options that you can use to make the infobox display how you want. Below we have listed all the standard tags, with sample wikitext and output HTML, to help you identify what you need to use, and how to give it a CSS makeover (see also Help:Infoboxes/CSS). Note that parser functions can also be used.
All infobox fields should be declared using XML convention, with attributes used for field configuration.[1]
<infobox>
The <infobox>
tag holds all others and delimits the scope of the infobox.
Valid tags
Parent tags | Child tags |
---|---|
None |
|
Attributes
theme
- The name of the theme to apply. Adds a class to the infobox of the form
.pi-theme-$1
, with spaces transformed into hyphens (-). Does not overwritetheme-source
ortype
. theme-source
- The name of the parameter to use as a theme. Adds a class to the infobox of the form
.pi-theme-$1
, with spaces transformed into hyphens (-). Does not overwritetheme
ortype
. type
- The name of the type to apply. Adds a class to the infobox of the form
.type-$1
, with spaces transformed into hyphens (-). Does not overwritetheme
ortheme-source
. accent-color-source
- The name of the parameter to use as an accent color.
accent-color-default
- The default accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g.
#f00
or#ff0000
. accent-color-text-source
- The name of the parameter to use as a text accent color.
accent-color-text-default
- The default text accent color. Accepts a 3- or 6-digit hexadecimal color code, e.g.
#f00
or#ff0000
. layout
- Possible values:
default
,stacked
. name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<infobox> <title source="title_source" /> </infobox>
- Output
<aside class="portable-infobox pi-background pi-theme-wikia pi-layout-default"> <h2 class="pi-item pi-item-spacing pi-title" data-source="title_source">Title</h2> </aside>
<title>
The <title>
tag states infobox title. Images used in <title>
tags do not appear on mobile.[2]
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
source
- The name of the parameter to use.
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<title source="title_source"> <default>{{PAGENAME}}</default> </title>
- Output
<h2 class="pi-item pi-item-spacing pi-title" data-source="title_source">Page name</h2>
<data>
The <data>
tag is the standard key-value tag.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
source
- The name of the parameter to use.
span
- The number of columns to span. Only available in smart groups.
layout
- Possible values:
default
. Only available in smart groups. name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<data source="name"> <label>First name</label> <default>John</default> </data>
- Output
<div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="name"> <h3 class="pi-data-label pi-secondary-font">First name</h3> <div class="pi-data-value pi-font">John</div> </div>
<label>
The <label>
tag can be used only inside other tags, check child tags column for more info. Accepts wikitext.
Valid tags
Parent tags | Child tags |
---|---|
|
None |
Attributes
None.
HTML output
- Input
<label>First name</label>
- Output
<h3 class="pi-data-label pi-secondary-font">First name</h3>
<default>
The <default>
tag text is used when "source
" data is not specified, can be used only inside other tags, check child tags column for more info. Accepts wikitext.
Valid tags
Parent tags | Child tags |
---|---|
|
None |
Attributes
None.
HTML output
- Input
<default>John</default>
- Output
<div class="pi-data-value pi-font">John</div>
<format>
The <format>
tag can be used only inside other tags, check child tags column for more info. Accepts wikitext.
Valid tags
Parent tags | Child tags |
---|---|
|
None |
Attributes
None.
HTML output
- Input
<data source="dollars"> <label>Regular price</label> <format>${{{dollars}}}</format> </data>
- Output
<div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="dollars"> <h3 class="pi-data-label pi-secondary-font">Regular price</h3> <div class="pi-data-value pi-font">$15</div> </div>
<image>
The <image>
tag is used to insert images or video inside an infobox. It can only be styled using the community's CSS, and cannot be manually resized. Images are normalized, such that [[File:Example.jpg]]
and Example.jpg
do the same thing. Multiple images can be passed by using a <gallery>
tag.
Here, the <default>
tag is used to specify an image to be used when no image has been chosen on an article. For example, <default>Example.jpg</default>
.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
source
- The name of the parameter to use.
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<image source="image" />
- Output
<figure class="pi-item pi-image" data-source="image"> <a href=".../File:Image.jpg" class="image image-thumbnail" title=""> <img src="Image.jpg" srcset="Image.jpg 1x, Image.jpg 2x" class="pi-image-thumbnail" alt="" data-image-key="Image.jpg" data-image-name="Image.jpg" width="" height=""> </a> </figure>
<alt>
The <alt>
tag can be used only inside <image>
tag.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
source
- The name of the parameter to use.
HTML output
- Input
<image source="image"> <alt source="alternative_title"> <default>Default alt text</default> </alt> </image>
- Output
<figure class="pi-item pi-image" data-source="image"> <a href=".../File:Image.jpg" class="image image-thumbnail" title="Default alt text"> <img src="Image.jpg" srcset="Image.jpg 1x, Image.jpg 2x" class="pi-image-thumbnail" alt="Default alt text" data-image-key="Image.jpg" data-image-name="Image.jpg" width="" height=""> </a> </figure>
The <caption>
tag can be used only inside <image>
tag.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
source
- The name of the parameter to use.
HTML output
- Input
<image source="image"> <caption source="caption"> <default>My caption</default> </caption> </image>
- Output
<figcaption class="pi-item-spacing pi-caption">My caption</figcaption>
<group>
The <group>
tag is used for grouping fields, and optionally accepts a header for each group. A group won't be rendered (including any headers) if all fields are empty. However, if the show
attribute is set to incomplete
, it will render all of the group's fields if at least one field is not empty.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
layout
- Possible values:
default
,horizontal
. show
- Possible values:
default
,incomplete
. collapse
- Possible values:
open
,closed
. Only available if the group's first child is a<header>
tag. row-items
- Turns the group into a smart group spanning n columns. Smart groups arrange their cells (
<data>
tags) horizontally, and automatically wrap to a new row once the current one exceeds that limit. Cells are stretched to take up as much space as possible on the last row. name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
Default group
- Input
<group> <header>Group name</header> <data source="value1" /> </group>
- Output
<section class="pi-item pi-group pi-border-color"> <h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background">Group name</h2> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="value1"> <div class="pi-data-value pi-font">Data value</div> </div> </section>
Horizontal group
- Input
<group layout="horizontal"> <header>Group name</header> <data source="value1"> <label>Data label</label> </data> </group>
- Output
<section class="pi-item pi-group pi-border-color"> <table class="pi-horizontal-group"> <caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">Group name</caption> <thead> <tr> <th class="pi-horizontal-group-item pi-data-label pi-secondary-font pi-border-color pi-item-spacing" data-source="value1">Data label</th> </tr> </thead> <tbody> <tr> <td class="pi-horizontal-group-item pi-data-value pi-font pi-border-color pi-item-spacing" data-source="value1">Data value</td> </tr> </tbody> </table> </section>
Smart group
- Input
<group row-items="3"> <header>Section Header</header> <data source="value 1"> <label>Label 1</label> </data> <data source="value 2"> <label>Label 2</label> </data> <data source="value 3"> <label>Label 3</label> </data> <data source="value 4" layout="default"> <label>Label 4</label> </data> <data source="value 5"> <label>Label 5</label> </data> <data source="value 6"> <label>Label 6</label> </data> </group>
- Output
<section class="pi-item pi-group pi-border-color"> <h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background">Section Header</h2> <section class="pi-item pi-smart-group pi-border-color"> <section class="pi-smart-group-head"> <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 1">Label 1</h3> <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 2">Label 2</h3> <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 3">Label 3</h3> </section> <section class="pi-smart-group-body"> <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 1">AAA</div> <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 2">BBB</div> <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 3 * 100%);" data-source="value 3">CCC</div> </section> </section> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="value 4"> <h3 class="pi-data-label pi-secondary-font">Label 4</h3> <div class="pi-data-value pi-font">DDD</div> </div> <section class="pi-item pi-smart-group pi-border-color"> <section class="pi-smart-group-head"> <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 5">Label 5</h3> <h3 class="pi-smart-data-label pi-data-label pi-secondary-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 6">Label 6</h3> </section> <section class="pi-smart-group-body"> <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 5">EEE</div> <div class="pi-smart-data-value pi-data-value pi-font pi-item-spacing" style="width: calc(1 / 2 * 100%);" data-source="value 6">FFF</div> </section> </section> </section>
<header>
The <header>
tag denotes the beginning of a section or group of tags.
Valid tags
Parent tags | Child tags |
---|---|
|
None |
Attributes
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<header>Header Text</header>
- Default group output
<h2 class="pi-item pi-header pi-secondary-font pi-item-spacing pi-secondary-background">Header Text</h2>
- Horizontal group output
<caption class="pi-header pi-secondary-font pi-secondary-background pi-item-spacing">Header Text</caption>
The <navigation>
tag is used for providing any wikitext.
Valid tags
Parent tags | Child tags |
---|---|
|
None |
Attributes
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<navigation>[[Link]]</navigation>
- Output
<nav class="pi-navigation pi-item-spacing pi-secondary-background pi-secondary-font"> <a href="/wiki/Link" title="Link">Link</a> </nav>
<panel>
The <panel>
tag is used to create tabbed interfaces, where the contents of each tab is wrapped in a <section>
tag.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<panel> <section> <label>A</label> <data source="one" /> <data source="two" /> </section> <section> <label>B</label> <data source="three" /> <data source="four" /> </section> </panel>
- Output
<section class="pi-item pi-panel pi-border-color"> <div class="pi-panel-scroll-wrapper"> <ul class="pi-section-navigation"> <li class="pi-section-tab pi-section-active" data-ref="0"> <div class="pi-section-label">A</div> </li> <li class="pi-section-tab" data-ref="1"> <div class="pi-section-label">B</div> </li> </ul> </div> <div class="pi-section-contents"> <div class="pi-section-content pi-section-active" data-ref="0"> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="one"> <div class="pi-data-value pi-font">1st</div> </div> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="two"> <div class="pi-data-value pi-font">2nd</div> </div> </div> <div class="pi-section-content" data-ref="1"> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="three"> <div class="pi-data-value pi-font">3rd</div> </div> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="four"> <div class="pi-data-value pi-font">4th</div> </div> </div> </div> </section>
<section>
The <section>
tag represents the contents of a tab. The clickable toggle is represented by a <label>
tag. Labels default to their zero-based index if omitted; if all tabs within a panel are unlabeled, then they are stacked vertically.
Valid tags
Parent tags | Child tags |
---|---|
|
|
Attributes
name
- Internal name for the element and its children. Assigned to the
data-item-name
attribute in the resulting HTML.
HTML output
- Input
<section> <label>A</label> <data source="one" /> <data source="two" /> </section>
- Output
<div class="pi-section-content" data-ref="0"> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="one"> <div class="pi-data-value pi-font">1st</div> </div> <div class="pi-item pi-data pi-item-spacing pi-border-color" data-source="two"> <div class="pi-data-value pi-font">2nd</div> </div> </div>