Template:Collection table test: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 16: Line 16:
|<nowiki></nowiki><noinclude><!--Start of row--></noinclude>
|<nowiki></nowiki><noinclude><!--Start of row--></noinclude>
{{!}}-
{{!}}-
{{#if:{{{icon|}}}<!--
<!--
    -->|{{#if: {{{3|Icon}}}<!--
If there's an icon, place it first
        -->|<nowiki></nowiki>
        -->{{#if:{{{icon|}}}|
<!--       -->{{!}} {{#if: {{{4|}}}| [[File:{{{4|}}}|40x40px]] |}}<!--
<!--       -->{{!}} {{#if: {{{4|}}}| [[File:{{{4|}}}|40x40px]] |}}<!--
        -->|}}<!--
            -->|<!--
-->|}}{{#if: {{{1|}}}|<nowiki></nowiki>
    -->}}<!--
<!---->{{!}} {{#if:{{{definedlink|}}}<!--
 
    -->|<!--
If there's a link defined, create it by definition, otherwise from predefined fixes
    -->|{{linkappend|pre={{#if:{{{prefix|}}}|{{{prefix|}}}&nbsp;|}}|post={{#if:{{{postfix|}}}|&nbsp;({{{postfix|}}})|}}|lc={{{attribute|}}}|{{{2|}}}}}<!--
        -->{{#if: {{{1|}}}|<nowiki></nowiki>
    -->}}<!--
<!--       -->{{!}} {{#if:{{{definedlink|}}}<!--
-->}}{{#if:{{{icon|}}}||{{#if: {{{3|Icon}}}|<nowiki></nowiki>
                -->|<!--
{{!}} {{#if: {{{4|}}}| {{{4|}}} |}} |}}}}{{#if: {{{5|}}}|<nowiki></nowiki>
                -->|{{linkappend|pre={{#if:{{{prefix|}}}|{{{prefix|}}}&nbsp;|}}|post={{#if:{{{postfix|}}}|&nbsp;({{{postfix|}}})|}}|lc={{{attribute|}}}|{{{2|}}}}}<!--
            -->}}<!--
        -->}}<!--
If there wasn't an icon, place next entry
        -->{{#if:{{{icon|}}}<!--
    -->|<!--
-->|{{#if: {{{3|}}}|<nowiki></nowiki>
<!--            -->{{!}} {{#if: {{{4|}}}| {{{4|}}} |}}<!--
                -->|<!--
        -->}}<!--
    -->}}<!--
-->{{#if: {{{5|}}}|<nowiki></nowiki>
{{!}} {{{6|}}}|}}{{#if: {{{7|}}}|<nowiki></nowiki>
{{!}} {{{6|}}}|}}{{#if: {{{7|}}}|<nowiki></nowiki>
{{!}} {{{8|}}}|}}{{#if: {{{9|}}}|<nowiki></nowiki>
{{!}} {{{8|}}}|}}{{#if: {{{9|}}}|<nowiki></nowiki>

Revision as of 08:35, 4 September 2020

Parameters
  • type: table:
    • suppresscategory: If this has a value, no category tag is added.
    • allowselflink: If this does not have a value, a class is added to the table preventing a link to the same article from becoming bold.
    • content: The rows for the table.
    • attribute: If it has a value, treats the first provided value as an attribute name (i.e. fully capitalized).
    • icon: If provided, treats the second provided value as an icon. Placing it ahead of the first entry and injecting a predefined image syntax around it.
    • prefix: If provided, a prefix is added as a clarifying term in in the link url
    • postfix: If provided, a postfix is added as a clarifying term in parenthesis in the link url
    • category: The category to add the article to (if not suppressed).
    • 1...n
  • type: row:
    • named parameters as defined by the table structure
Usage

Create an intermediate template with the following approximate structure:

{{collection table
| type={{{type|table}}}
| suppresscategory={{{suppresscategory|<noinclude>template</noinclude>}}}
| allowselflink={{{allowselflink}}}
| content={{{1|}}}
| attribute=true
| postfix=Panel Attribute
| category=Panel Attributes
| Attribute name | {{{attribute|}}}<!--
-->| Unit | {{{unit|}}}<!--
-->| Description | {{{description|}}}<!--
-->}}

Set the category to the category the individual entries need to be collected under (plural). Set the postfix to the clarifying term in the parenthesis in the title (singular). The remainder of the attributes come in pairs: The name in the header, and the parameter used in the rows.

The first value is always a link to a specific article.

Category is automatically included on the page that template is used on (unless supressed) if a category is configured. The first value in the table is automaticallly postfixed if a postfix is configured.

The following parameters must be used when using the final template:

  • suppresscategory: on the overview page
  • allowselflink: on the overview page
  • 1: the content for the table
  • type: table to specify the table is being defined
  • type: row to specify the row is being defined
  • attributes defined in the intermediate template for content of rows

On the overview page, structure the template as follows to create a seamless overview:

{{panel attributes|suppresscategory=true|allowselflinks=true|
{{:Visible (Panel Attribute)}}
}}

On the specific page, structure the template as follows to allow for inclusion onto an overview page:

{{panel attributes
| <onlyinclude>
{{panel attributes|type=row|attribute=VISIBLE|unit={{boolean}}|description=Whether you can see it}} </onlyinclude>
}}