Difference between revisions of "Template:For Each Unique/Raw"
(Created page with "<noinclude>Helper for Template:For Each Unique. * First parameter: string to split * Second parameter: delimiter to search for * Third parameter: replacement delimiter * F...") |
m (2 revisions imported: Initial import from smithfam) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 4: | Line 4: | ||
* Third parameter: replacement delimiter | * Third parameter: replacement delimiter | ||
* Fourth parameter: current replacement delimiter | * Fourth parameter: current replacement delimiter | ||
| − | * ''template'': template to apply to each substring (string provided as first parameter; index passed as ''index'') | + | * ''template'': template to apply to each substring (string provided as first parameter; index passed as ''index''; ''param'' is passed as ''param'') |
| + | * ''param'': parameter to pass to the template | ||
* ''index'': current split index (1-based) | * ''index'': current split index (1-based) | ||
* ''out index'': current index in the non-repeating list | * ''out index'': current index in the non-repeating list | ||
| Line 15: | Line 16: | ||
| {{For Each Unique/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}| | | {{For Each Unique/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{4}}}| | ||
| template={{{template}}} | | template={{{template}}} | ||
| + | | param={{{param}}} | ||
| index={{#expr: {{{index}}} + 1}} | | index={{#expr: {{{index}}} + 1}} | ||
| out index={{{out index}}} | | out index={{{out index}}} | ||
| Line 20: | Line 22: | ||
| previous={{{previous}}} | | previous={{{previous}}} | ||
}} | }} | ||
| − | | {{{{{template}}}|{{{value}}}| index={{{out index}}}}}{{For Each Unique/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{3}}}| | + | | {{{{{template}}}|{{{value}}}| index={{{out index}}} | param={{{param}}} }}{{For Each Unique/Raw|{{{1}}}|{{{2}}}|{{{3}}}|{{{3}}}| |
| template={{{template}}} | | template={{{template}}} | ||
| + | | param={{{param}}} | ||
| index={{#expr: {{{index}}} + 1}} | | index={{#expr: {{{index}}} + 1}} | ||
| out index={{#expr: {{{out index}}} + 1}} | | out index={{#expr: {{{out index}}} + 1}} | ||
Latest revision as of 19:14, 8 December 2015
Helper for Template:For Each Unique.
- 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 is passed as param)
- param: parameter to pass to the template
- index: current split index (1-based)
- out index: current index in the non-repeating list
- value: current split value
- previous: previous split value