Difference between revisions of "Template:For Each/Raw"
| Line 7: | Line 7: | ||
* ''value'': current split value | * ''value'': current split value | ||
</noinclude><includeonly>{{#if: {{{value}}} | </noinclude><includeonly>{{#if: {{{value}}} | ||
| − | | {{{{{template}}}|{{{value}}}| | + | | {{#ifeq:{{{index}}}|1||{{{3}}}}}{{{{{template}}}|{{{value}}}| |
index={{{index}}} | index={{{index}}} | ||
| − | + | }}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}| | |
| template={{{template}}} | | template={{{template}}} | ||
| index={{#expr: {{{index}}} + 1}} | | index={{#expr: {{{index}}} + 1}} | ||
| value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}} | | value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}} | ||
}}}}</includeonly> | }}}}</includeonly> | ||
Revision as of 23:06, 14 June 2015
Helper for Template:For Each.
- First parameter: string to split
- Second parameter: delimiter to search for
- Third parameter: replacement delimiter
- template: template to apply to each substring (string provided as first parameter; index passed as index)
- index: current split index; 1-based
- value: current split value