Template:PropVals/doc

From Salem Wiki
< Template:PropVals
Revision as of 00:44, 25 June 2012 by ©TriMoon™ (talk | contribs) (added list of sub-templates)
Jump to: navigation, search

Description

This is the main-entry-point of a complex template-class
It is used to automatically list all the values of a property of a page as an un-ordered list.
This generated-output will be used in {{Infobox}} to automatically show relevant info.
See these pages for documentation on functions used:
Other pages with relevant info are:

Functional logic

  • {{PropVals}} is used as a wrapper to inject extra arguments into {{PropVals/List}}, using the output of {{PropVals/getGroupedRecords}}.
    1. {{PropVals/List}} is used as a wrapper to inject extra arguments into {{PropVals/Print Entry}}, to output each entry of a grouped-record under a common group-heading when appropriate, as list-items <li>...</li>.
      • {{PropVals/Print Entry}} is used to display each entry in a visually appealing way, by outputting an icon-image followed by a link to the page of the object followed by the amount.
        It uses {{PropVals/Split}} to extract the name- and amount-fields from the entry.
        The amount should not always be displayed, because not all properties have amounts...
    2. {{PropVals/getGroupedRecords}} is used as a wrapper to inject extra arguments into {{PropVals/Group}}, using the output of {{PropVals/getRecords}} as input, to output grouped-records, for further processing by {{PropVals}}.
      1. {{PropVals/Group}} is used as a wrapper to inject extra arguments into {{PropVals/Group/NextPart}}, using records as input, to output grouped-records.
        • {{PropVals/Group/NextPart}} is used as a helper-template, to output a grouped-record that starts with the group-heading followed by entries, with their heading-field removed, that have the same heading-field as the previous entry.
          It uses {{PropVals/Split}} to separate the group-heading (heading-field), from the Objectname and Amount in the record.
      2. {{PropVals/getRecords}} is used to retrieve all the values of a property of a page, and output them as records for further processing by {{PropVals/getGroupedRecords}}.

Syntax

Type the below code somewhere inside {{Infobox}} or a page:
{{PropVals |prop=RequiresObj |page={{FULLPAGENAME}} |sep={{{sep|;}}} |grpsep={{{grpsep|/\}}} }}

Examples

  1. {{PropVals|prop=RequiresObj|page=Stone Hedge}} gives:

    Sub-templates