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

From Salem Wiki
Jump to: navigation, search
m (correcting bug in output when no group-heading was provided in the record, causing the amount not to appear.)
m (Protected "Template:PropVals/Group/NextPart": Key feature of wiki ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><!--
+
<onlyinclude>{{#if: {{{val|}}}
-->{{#ifeq: {{PropVals/Group/heading
+
| {{#ifeq: {{PropVals/Group/heading
 +
|sep={{{sep|;}}}
 +
|{{{preval|}}}
 +
}}
 +
|
 +
{{PropVals/Group/heading
 +
|sep={{{sep|;}}}
 +
|{{{val|}}}
 +
}}
 +
|
 +
| {{#if: {{{preval|}}} | {{{grpsep|/\}}} }}<!--
 +
-->heading=<!--
 +
-->{{PropVals/Group/heading
 +
|sep={{{sep|;}}}
 +
|{{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 +
}}
 +
}}<!--
 +
-->{{#if: {{{preval|}}}{{PropVals/Group/heading
 +
|sep={{{sep|;}}}
 +
|{{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 +
}}
 +
| {{!}}
 +
}}<!--
 +
-->{{PropVals/Split
 +
|val={{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 
|sep={{{sep|;}}}
 
|sep={{{sep|;}}}
|{{{preval|}}}
+
|part=head
}}
+
}}<!--
|
+
-->{{{sep|;}}}<!--
{{PropVals/Group/heading
+
-->{{PropVals/Split
 +
|val={{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 
|sep={{{sep|;}}}
 
|sep={{{sep|;}}}
|{{{val|}}}
+
|part=1
}}
+
}}
|
+
| <dl class="error"><!--
| {{#if: {{{preval|}}} | {{{grpsep|/\}}}<nowiki> </nowiki> }}<!--
+
--><dt>PropVals/Group/NextPart:<!--
-->heading=<!--
+
--><dd>You need to <u>at-least</u> provide a record as value for the current-record in the "'''val'''" parameter !<!--
-->{{PropVals/Group/heading
+
--></dl><!--
|sep={{{sep|;}}}
+
-->}}<!--
|{{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 
}}
 
}}<!--
 
-->{{#if: {{{preval|}}} | {{!}} }}<!--
 
-->{{PropVals/Split
 
|val={{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 
|sep={{{sep|;}}}
 
|part=head
 
}}<!--
 
-->{{{sep|;}}}<!--
 
-->{{PropVals/Split
 
|val={{{val|Objectname{{{sep|;}}}Amount{{{sep|;}}}Groupheading}}}
 
|sep={{{sep|;}}}
 
|part=1
 
}}<!--
 
 
--></onlyinclude><noinclude>{{documentation}}</noinclude>
 
--></onlyinclude><noinclude>{{documentation}}</noinclude>

Latest revision as of 18:10, 25 July 2012

PropVals/Group/NextPart:
You need to at-least provide a record as value for the current-record in the "val" parameter !


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

Description

This template is used, as a helper-template by {{PropVals/Group}}, to output grouped-records.
These grouped-records begin with the group-heading followed by entries.
The group-heading in the output is {{{grpsep}}}heading= followed by the heading-field, to allow {{PropVals/List}} to recognize it as the group-heading tobe used.
An entry is a record with its heading-field removed, that has the same heading-field as the previous record.
It uses {{PropVals/Group/heading}} and {{PropVals/Split}} to separate the fields in a record.
The structure of a record is: Objectname{{{sep}}}Amount{{{sep}}}Groupheading

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