Difference between revisions of "Template:For Each/Raw"

From Green Family Wiki
Jump to: navigation, search
Line 9: Line 9:
 
| {{{{{template}}}|{{{value}}}|
 
| {{{{{template}}}|{{{value}}}|
 
   index={{{index}}}
 
   index={{{index}}}
}}{{{3}}}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|
+
}}}}{{{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 23:01, 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