Template:Content description: Difference between revisions

From the Super Mario Wiki, the Mario encyclopedia
Jump to navigationJump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<includeonly>{{#if:{{{wikitable|}}}|{{{!}} class="wikitable {{#if:{{{sortable|}}}|sortable}} {{#if:{{{dk|}}}|dk}}" style="text-align:center"}}
<includeonly>{{#if:{{{rowsonly|}}}||{{{!}} class="wikitable {{#if:{{{dk|}}}|dk}} {{#if:{{{sortable|}}}|sortable}}" style="text-align:center"}}
! {{#if:{{{sortable|}}}|class="unsortable"}} width="12%" | {{{imagelabel|Image}}}
! width="12%" class="unsortable" | {{{imagelabel|Image}}}
! width="10%" | Name
! width="10%" | Name
! {{#if:{{{sortable|}}}|class="unsortable" {{!}}}} {{{descriptionlabel|Description}}}
! class="unsortable" | {{{descriptionlabel|Description}}}
{{#forargs:name|key|value|<nowiki/>
{{#forargs:name|key|value|<nowiki/>
{{!}}-
{{!}}-
{{!}} {{{image{{#var:key}}|}}} {{!}}{{!}} {{#var:value}} {{!}}{{!}} style="text-align:left" {{!}} {{{description{{#var:key}}|}}}
{{!}} {{{image{{#var:key}}|}}} {{!}}{{!}} {{#var:value}} {{!}}{{!}} style="text-align:left" {{!}} {{{description{{#var:key}}|}}}
}}
}}
{{#if:{{{wikitable|}}}|{{!}}}|}}</includeonly><noinclude>
{{#if:{{{rowsonly|}}}||{{!}}}|}}</includeonly><noinclude>
This template establishes a consistent format for displaying a list of subjects on a game page and their respective descriptions. If you also want to list where something appears first and last, see {{tem|content appearances}}.
This template establishes a consistent format for displaying a list of subjects on a game page and their respective descriptions. If you also want to list where something appears first and last, see {{tem|content appearances}}.


Line 25: Line 25:
This works for any amount of numbered <code>image</code>/<code>name</code>/<code>description</code> parameters.
This works for any amount of numbered <code>image</code>/<code>name</code>/<code>description</code> parameters.


Additionally, if the value of <code>dk</code> is set to <code>y</code>, then the <code>dk</code> class is applied to the wikitable. Granted, <code>wikitable</code> must be set to <code>y</code> to use this as a standalone wikitable rather than as rows within a wikitable. You can also apply the <code>sortable</code> class to the wikitable by setting the value of <code>sortable</code> to <code>y</code>.
=== Optional parameters ===
*<code>dk</code> - Set to <code>y</code> to apply the <tt>dk</tt> class to the wikitable.
*<code>sortable</code> - Set to <code>y</code> to apply the <tt>sortable</tt> class to the wikitable.
*<code>rowsonly</code> - Set to <code>y</code> to use this as rows within a table rather than a standalone wikitable.


[[Category:Content templates]]</noinclude>
[[Category:Content templates]]</noinclude>

Revision as of 09:06, June 11, 2024

This template establishes a consistent format for displaying a list of subjects on a game page and their respective descriptions. If you also want to list where something appears first and last, see {{content appearances}}.

For large lists, only use this once you're absolutely certain that everything has been added, since the manual process of adding a new entry in alphabetical order could result in all following numbered parameters each having to be incremented by one.

Usage

The syntax is as follows:

{{content description
|image1=
|name1=
|description1=
}}

This works for any amount of numbered image/name/description parameters.

Optional parameters

  • dk - Set to y to apply the dk class to the wikitable.
  • sortable - Set to y to apply the sortable class to the wikitable.
  • rowsonly - Set to y to use this as rows within a table rather than a standalone wikitable.