Difference between revisions of "Template:ForEach"

From West Of Vipers Gate
m
m
 
Line 48: Line 48:
 
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{48}}}}}}} }}{{#if: {{{49|}}}
 
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{48}}}}}}} }}{{#if: {{{49|}}}
 
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{49}}}}}}} }}{{#if: {{{50|}}}
 
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{49}}}}}}} }}{{#if: {{{50|}}}
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{50}}}}}}} }}</onlyinclude>
+
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{50}}}}}}} }}{{#if: {{{51|}}}
 +
| {{#if: {{{join|}}} | {{{join}}} }}{{ {{{1}}} |{{#if: 1|{{{51}}}}}}} }}</onlyinclude>
 
== Usage ==
 
== Usage ==
 
<pre>{{ForEach|Template_To_Use|join=<string between invocations>
 
<pre>{{ForEach|Template_To_Use|join=<string between invocations>

Latest revision as of 21:47, 1 February 2022

Usage

{{ForEach|Template_To_Use|join=<string between invocations>
|First
|Second
|Third
|Fourth
}}

Using Repeat/Sample for the template (which just prepends "Hello " to the string) and join=,  yields:

Hello First, Hello Second, Hello Third, Hello Fourth