Template:For Each/Raw: Difference between revisions

From Fish Family Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
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}}}
}}{{{3}}}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|
}}{{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 00:06, 15 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