Difference between revisions of "Template:For Each/Raw"
| Line 7: | Line 7: | ||
* ''index'': current split index (1-based) | * ''index'': current split index (1-based) | ||
* ''value'': current split value | * ''value'': current split value | ||
| − | </noinclude><includeonly> | + | </noinclude><includeonly>{{Select|{{{4}}}| |
| param={{#if: {{{value}}} | 1}} | | param={{#if: {{{value}}} | 1}} | ||
| − | }} | + | }}{{#if: {{{value}}} |
| {{{{{template}}}|{{{value}}}| index={{{index}}}}}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{3}}}| | | {{{{{template}}}|{{{value}}}| index={{{index}}}}}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{3}}}| | ||
| template={{{template}}} | | template={{{template}}} | ||
| index={{#expr: {{{index}}} + 1}} | | index={{#expr: {{{index}}} + 1}} | ||
| value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}} | | value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}} | ||
| − | }}}} | + | }}}}</includeonly> |
Revision as of 19:32, 22 June 2015
Helper for Template:For Each.
- First parameter: string to split
- Second parameter: delimiter to search for
- Third parameter: replacement delimiter
- Fourth parameter: current 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