Difference between revisions of "Template:PropVals/Print Entry/doc"
From Salem Wiki
m (→Description: update) |
m (Protected "Template:PropVals/Print Entry/doc": Documentation of key-feature ([edit=sysop] (indefinite) [move=sysop] (indefinite))) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
: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. | :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 {{t|PropVals/Split}} to extract the name- and amount-fields from the '''''entry'''''. | :It uses {{t|PropVals/Split}} to extract the name- and amount-fields from the '''''entry'''''. | ||
− | :It uses {{t| | + | :It uses {{t|PropVals/getIcon|name-field}} to fetch the icon-image to display. |
− | |||
− | |||
: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== | ||
Line 16: | Line 15: | ||
:**'''showamount''' | :**'''showamount''' | ||
:**:Optional; Controls the display of the amount-field. | :**:Optional; Controls the display of the amount-field. | ||
− | :**:Any value that differs from "no" will make it display the amount-field. | + | :**:<u>Any value</u> that differs from "'''no'''" will make it display the amount-field. |
− | :**:Defaults to "no". | + | :**:Defaults to "yes". |
+ | :**'''userparam''' | ||
+ | :**:Optional; Controls the display of the amount-field, when used as a '''result-formater in SMW-Queries'''. | ||
+ | :**:<u>Any value</u> that differs from "'''no'''" will make it display the amount-field. | ||
+ | :**:Defaults to value of '''showamount''' including the default of that. | ||
:*1 '''''entry''''' as unnamed-parameter: | :*1 '''''entry''''' as unnamed-parameter: | ||
:*:An entry has the following structure: '<nowiki/>''Objectname'''''sep'''''Amount''<nowiki/>' | :*:An entry has the following structure: '<nowiki/>''Objectname'''''sep'''''Amount''<nowiki/>' | ||
:*:Using the default '''sep''' that could look like 'Board;10' | :*:Using the default '''sep''' that could look like 'Board;10' | ||
+ | |||
==Examples== | ==Examples== | ||
#{{t|PropVals/Print Entry|Anvil;10}} or {{t|PropVals/Print Entry|sep<nowiki>=</nowiki>;|Anvil;10}} gives:<br/>{{PropVals/Print Entry|sep=;|Anvil;10}} | #{{t|PropVals/Print Entry|Anvil;10}} or {{t|PropVals/Print Entry|sep<nowiki>=</nowiki>;|Anvil;10}} gives:<br/>{{PropVals/Print Entry|sep=;|Anvil;10}} | ||
− | #{{t|PropVals/Print Entry|showamount<nowiki>=</nowiki> | + | #{{t|PropVals/Print Entry|showamount<nowiki>=</nowiki>no|Anvil;10}} or {{t|PropVals/Print Entry|sep<nowiki>=</nowiki>;|showamount<nowiki>=</nowiki>no|Anvil;10}} gives:<br/>{{PropVals/Print Entry|sep=;|showamount=no|Anvil;10}} |
<includeonly>[[Category:Templates|{{PAGENAME}}]]<!-- Any categories for the template itself --> | <includeonly>[[Category:Templates|{{PAGENAME}}]]<!-- Any categories for the template itself --> | ||
[[Category:Templates/©TriMoon™|{{SUBPAGENAME}}]] | [[Category:Templates/©TriMoon™|{{SUBPAGENAME}}]] | ||
</includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude> | </includeonly><noinclude>[[Category:Template documentation|{{PAGENAME}}]]</noinclude> |
Latest revision as of 18:13, 25 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 {{PropVals/getIcon|name-field}} to fetch the icon-image to display.
- 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 "yes".
- userparam
- Optional; Controls the display of the amount-field, when used as a result-formater in SMW-Queries.
- Any value that differs from "no" will make it display the amount-field.
- Defaults to value of showamount including the default of that.
- sep
- 1 entry as unnamed-parameter:
- An entry has the following structure: 'ObjectnamesepAmount'
- Using the default sep that could look like 'Board;10'
- named-parameters:
Examples
- {{PropVals/Print Entry|Anvil;10}} or {{PropVals/Print Entry|sep=;|Anvil;10}} gives:
Anvil x10 - {{PropVals/Print Entry|showamount=no|Anvil;10}} or {{PropVals/Print Entry|sep=;|showamount=no|Anvil;10}} gives:
Anvil