Template:For Each/Raw: Difference between revisions

From Ludlow Family Wiki
Jump to navigation Jump to search
No edit summary
m (12 revisions imported: Initial import from smithfam)
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
* Second parameter: delimiter to search for
* Second parameter: delimiter to search for
* Third parameter: replacement delimiter
* Third parameter: replacement delimiter
* ''template'': template to apply to each substring (string provided as first parameter; index passed as ''index'')
* Fourth parameter: current replacement delimiter
* ''index'': current split index; 1-based
* ''template'': template to apply to each substring (string provided as first parameter; index passed as ''index''; ''param'' passed as ''param'')
* ''param'': extra parameter to pass to the template
* ''index'': current split index (1-based)
* ''value'': current split value
* ''value'': current split value
</noinclude><includeonly>{{#if: {{{value}}}
</noinclude><includeonly>{{Select|{{{4}}}|
| {{{{{template}}}|{{{value}}}|
| param={{#if: {{{value}}} | 1}}
  index={{{index}}}
}}{{#if: {{{value}}}
}}{{{3}}}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|
| {{{{{template}}}|{{{value}}}| index={{{index}}} | param={{{param}}} }}{{For Each/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{3}}}|
| template={{{template}}}
| template={{{template}}}
| param={{{param}}}
| index={{#expr: {{{index}}} + 1}}
| index={{#expr: {{{index}}} + 1}}
| value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}}
| value={{#explode:{{{1}}}|{{{2}}}|{{{index}}}}}
}}}}</includeonly>
}}}}</includeonly>

Latest revision as of 20:14, 8 December 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; param passed as param)
  • param: extra parameter to pass to the template
  • index: current split index (1-based)
  • value: current split value