Difference between revisions of "Template:PropVals/Group/NextPart/doc"

From Salem Wiki
Jump to: navigation, search
m (→‎Description: updated with proper explanation of its purpose and use)
m (→‎Examples: adding 1st-call examples)
Line 14: Line 14:
 
}}</pre>
 
}}</pre>
 
==Examples==
 
==Examples==
 +
#{{t|PropVals/Group/NextPart|val<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount|sep<nowiki>={{{sep|;}}}</nowiki>|grpsep<nowiki>={{{grpsep|/\}}}</nowiki>}}<br/>gives:<br/>{{PropVals/Group/NextPart
 +
|val=Objectname{{{sep|;}}}Amount
 +
|sep={{{sep|;}}}
 +
|grpsep={{{grpsep|/\}}}
 +
}}
 +
#{{t|PropVals/Group/NextPart|val<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading|sep<nowiki>={{{sep|;}}}</nowiki>|grpsep<nowiki>={{{grpsep|/\}}}</nowiki>}}<br/>gives:<br/>{{PropVals/Group/NextPart
 +
|val=Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading
 +
|sep={{{sep|;}}}
 +
|grpsep={{{grpsep|/\}}}
 +
}}
 
#{{t|PropVals/Group/NextPart|preval<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading|val<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading|sep<nowiki>={{{sep|;}}}</nowiki>|grpsep<nowiki>={{{grpsep|/\}}}</nowiki>}}<br/>gives:<br/>{{PropVals/Group/NextPart
 
#{{t|PropVals/Group/NextPart|preval<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading|val<nowiki>=</nowiki>Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading|sep<nowiki>={{{sep|;}}}</nowiki>|grpsep<nowiki>={{{grpsep|/\}}}</nowiki>}}<br/>gives:<br/>{{PropVals/Group/NextPart
 
|preval=Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading
 
|preval=Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading

Revision as of 19:17, 23 June 2012

Description

This template is used, as a helper-template inside {{PropVals/Group}}, to output a grouped-record that starts with the heading-field followed by records, with their heading-field removed, that have the same heading-field as the previous record.
These grouped-records begin with the group-separator followed by the heading-field, when the heading-field of the current-record differs from the one in the previous-record.
The heading-field in the output will be prepended with "heading=" to allow {{PropVals/List}} to recognize it as the group-heading tobe used.
It uses {{PropVals/Group/heading}} to extract the heading-field of the provided records.

Syntax

Type the below code somewhere inside your code:
{{PropVals/Group/NextPart
|preval=<previous record>
|val=<current record>
|sep={{{sep|;}}}
|grpsep={{{grpsep|/\}}}
}}

Examples

  1. {{PropVals/Group/NextPart|val=Objectname;Amount|sep={{{sep|;}}}|grpsep={{{grpsep|/\}}}}}
    gives:
    Objectname;Amount
  2. {{PropVals/Group/NextPart|val=Objectname;Amount;Groupheading|sep={{{sep|;}}}|grpsep={{{grpsep|/\}}}}}
    gives:
    heading=Groupheading|Objectname;Amount
  3. {{PropVals/Group/NextPart|preval=Objectname;Amount;Groupheading|val=Objectname;Amount;Groupheading|sep={{{sep|;}}}|grpsep={{{grpsep|/\}}}}}
    gives:
    |Objectname;Amount
  4. {{PropVals/Group/NextPart|preval=Objectname;Amount;Grouphead|val=Objectname;Amount;Groupheading|sep={{{sep|;}}}|grpsep={{{grpsep|/\}}}}}
    gives:
    /\heading=Groupheading|Objectname;Amount