Difference between revisions of "Template:PropVals/List"

From Salem Wiki
Jump to: navigation, search
m (Increased info on error-msg)
m (Protected "Template:PropVals/List": Key feature of wiki ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(3 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
| <li>'''{{{heading}}}:'''<ul>
 
| <li>'''{{{heading}}}:'''<ul>
 
}}<!--
 
}}<!--
-->{{#if: {{{1|}}} | <li>{{PropVals/Print Entry|{{{1}}} }}</li> }}<!--
+
-->{{#if: {{{1|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{1}}} }}</li> }}<!--
-->{{#if: {{{2|}}} | <li>{{PropVals/Print Entry|{{{2}}} }}</li> }}<!--
+
-->{{#if: {{{2|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{2}}} }}</li> }}<!--
-->{{#if: {{{3|}}} | <li>{{PropVals/Print Entry|{{{3}}} }}</li> }}<!--
+
-->{{#if: {{{3|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{3}}} }}</li> }}<!--
-->{{#if: {{{4|}}} | <li>{{PropVals/Print Entry|{{{4}}} }}</li> }}<!--
+
-->{{#if: {{{4|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{4}}} }}</li> }}<!--
-->{{#if: {{{5|}}} | <li>{{PropVals/Print Entry|{{{5}}} }}</li> }}<!--
+
-->{{#if: {{{5|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{5}}} }}</li> }}<!--
-->{{#if: {{{6|}}} | <li>{{PropVals/Print Entry|{{{6}}} }}</li> }}<!--
+
-->{{#if: {{{6|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{6}}} }}</li> }}<!--
-->{{#if: {{{7|}}} | <li>{{PropVals/Print Entry|{{{7}}} }}</li> }}<!--
+
-->{{#if: {{{7|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{7}}} }}</li> }}<!--
-->{{#if: {{{8|}}} | <li>{{PropVals/Print Entry|{{{8}}} }}</li> }}<!--
+
-->{{#if: {{{8|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{8}}} }}</li> }}<!--
-->{{#if: {{{9|}}} | <li>{{PropVals/Print Entry|{{{9}}} }}</li> }}<!--
+
-->{{#if: {{{9|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{9}}} }}</li> }}<!--
-->{{#if: {{{10|}}} | <li>{{PropVals/Print Entry|{{{10}}} }}</li> }}<!--
+
-->{{#if: {{{10|}}} | <li>{{PropVals/Print Entry |sep={{{sep|;}}} |showamount={{{showamount|no}}} |{{{10}}} }}</li> }}<!--
 +
-->{{#if: {{{heading|}}}
 +
| </ul></li>
 +
}}<!--
 
-->{{#if: {{{11|}}}
 
-->{{#if: {{{11|}}}
 
| <dl class="error"><!--
 
| <dl class="error"><!--
Line 21: Line 24:
 
--></dl><!--
 
--></dl><!--
 
-->}}<!--
 
-->}}<!--
-->{{#if: {{{heading|}}}
 
| </ul></li>
 
}}<!--
 
 
--></onlyinclude><!--
 
--></onlyinclude><!--
 
--><noinclude></ul>{{documentation}}</noinclude>
 
--><noinclude></ul>{{documentation}}</noinclude>

Latest revision as of 18:12, 25 July 2012


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

    Description

    This template is used to output each entry of a grouped-record under a common group-heading when appropriate, as list-items <li>...</li>.
    It is used as a wrapper to inject extra arguments into {{PropVals/Print Entry}}, to output each entry.

    Syntax

    Type the below code somewhere inside your code: {{PropVals/List}}
    It accepts the following parameters:
    • named-parameters:
      • heading
        Optional; Controls the display of a group-heading when provided.
        Defaults to being empty, thus not grouping entries under a group-heading.
      • sep
        Optional; The separator to use for splitting the fields inside the entry by {{PropVals/Print Entry}}.
        Defaults to a dot-colon ';'
      • showamount
        Optional; Controls the display of the amount-field by {{PropVals/Print Entry}}.
        Any value that differs from "no" will make it display the amount-field.
        Defaults to "no".
    • Any amount of entries as unnamed-parameters:
      These unnamed-parameters will be injected into {{PropVals/Print Entry}} one by one. (currently max. 10 supported)
      An entry has the following structure: 'ObjectnamesepAmount'
      Using the default sep that could look like 'Board;10'

    Examples

    1. <ul>
      {{PropVals/List|sep=;|showamount=no|Anvil;|Flint;1|Stone;3}}
      {{PropVals/List|sep=;|showamount=y|heading=Startpost|Lime;15|Flint;15|Stone;30}}
      {{PropVals/List|sep=;|showamount=yes|heading=|Board;10|Nails;4}}
      </ul>
      gives: