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

From Salem Wiki
Jump to: navigation, search
m (using different CSS-Rule to prevent word-wrapping in displayed name)
m (Protected "Template:PropVals/Print Entry": Key feature of wiki ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude><!--
 
<onlyinclude><!--
-->{{#if: {{HasProp
+
--><span style="white-space:nowrap;"><!--
|page={{PropVals/Split
+
-->{{PropVals/getIcon
|val={{{1|}}}
+
|{{PropVals/Split
|sep={{{sep|;}}}
+
|val={{{1|{{FULLPAGENAME}} }}}
}}
+
|sep={{{sep|;}}}
|Has icon
 
}}
 
| {{ #ifexist:
 
{{#show: {{PropVals/Split
 
|val={{{1|}}}
 
|sep={{{sep|;}}}
 
}}
 
|?Has icon
 
|link=none
 
}}
 
| [[<!--
 
-->{{#show: {{PropVals/Split
 
|val={{{1|}}}
 
|sep={{{sep|;}}}
 
}}
 
|?Has icon
 
|link=none
 
}}<!--
 
-->{{!}}30px]]<nowiki> </nowiki>
 
 
}}
 
}}
}}<!--
+
}} <!--
-->[[{{PropVals/Split
+
-->[[{{ PropVals/Split
 
|val={{{1}}}
 
|val={{{1}}}
 
|sep={{{sep|;}}}
 
|sep={{{sep|;}}}
}}<!--
+
}}]]<!--
-->{{!}}<span style="white-space:nowrap;"><!--
 
-->{{PropVals/Split
 
|val={{{1}}}
 
|sep={{{sep|;}}}
 
}}<!--
 
--></span>]]<!--
 
 
-->{{#ifeq: {{{userparam|{{{showamount|yes}}} }}} | no
 
-->{{#ifeq: {{{userparam|{{{showamount|yes}}} }}} | no
 
|
 
|
Line 53: Line 28:
 
}}
 
}}
 
}}<!--
 
}}<!--
 +
--></span><!--
 
--></onlyinclude><noinclude>{{documentation}}</noinclude>
 
--></onlyinclude><noinclude>{{documentation}}</noinclude>

Latest revision as of 18:13, 25 July 2012

No image found, click to upload [[{{{1}}}]] x1

Template documentation (for the template shown above, sometimes hidden or invisible)

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.
  • 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=no|Anvil;10}} or {{PropVals/Print Entry|sep=;|showamount=no|Anvil;10}} gives:
    Anvil icon.png Anvil