Difference between revisions of "Template:PropVals/Print Entry/doc"

From Salem Wiki
Jump to: navigation, search
m (→‎Description: update)
m (→‎Description: updated with usage inside Infobox)
Line 6: Line 6:
 
::The composed filename of the icon-image is composed of the name-field followed by "_icon.png".
 
::The composed filename of the icon-image is composed of the name-field followed by "_icon.png".
 
:The ''generated-output'' will be used by {{t|PropVals/List}}.
 
:The ''generated-output'' will be used by {{t|PropVals/List}}.
 +
:This template will also be used by the embedded SMW-Query inside {{t|Infobox}} as a [http://semantic-mediawiki.org/wiki/Help:Template_format result-formater] to display values of [[Property:RequiredBy|RequiredBy]].
  
 
==Syntax==
 
==Syntax==

Revision as of 17:52, 4 July 2012

Description

This template is used to display an entry of a grouped-record in a visually appealing way, by outputting an icon-image followed by a link to the page of the object followed by the amount when requested.
It uses {{PropVals/Split}} to extract the name- and amount-fields from the entry.
It uses {{HasProp|Has icon}}, on the page of the entry to be displayed, and use that as icon-image to display.
If it can't find that property then it will auto-compose a filename for the icon-image to use:
The composed filename of the icon-image is composed of the name-field followed by "_icon.png".
The generated-output will be used by {{PropVals/List}}.
This template will also be used by the embedded SMW-Query inside {{Infobox}} as a result-formater to display values of RequiredBy.

Syntax

Type the below code somewhere inside your code: {{PropVals/Print Entry}}
It accepts the following parameters:
  • named-parameters:
    • sep
      Optional; The separator to use for splitting the fields inside the entry.
      Defaults to a dot-colon ';'
    • showamount
      Optional; Controls the display of the amount-field.
      Any value that differs from "no" will make it display the amount-field.
      Defaults to "no".
  • 1 entry as unnamed-parameter:
    An entry has the following structure: 'ObjectnamesepAmount'
    Using the default sep that could look like 'Board;10'

Examples

  1. {{PropVals/Print Entry|Anvil;10}} or {{PropVals/Print Entry|sep=;|Anvil;10}} gives:
    Anvil icon.png Anvil x10
  2. {{PropVals/Print Entry|showamount=y|Anvil;10}} or {{PropVals/Print Entry|sep=;|showamount=y|Anvil;10}} gives:
    Anvil icon.png Anvil x10