Template:For Each Unique/Raw: Difference between revisions

From Ludlow Family Wiki
Jump to navigation Jump to search
(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...")
 
No edit summary
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}}

Revision as of 11:05, 25 June 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