Difference between revisions of "Template:Foreach"

From DFM Wiki
(Created page with "<includeonly><!-- -->{{#if:{{{2|}}}|<!-- -->{{<!-- -->{{{1}}}|{{{2}}}<!-- -->}}<!-- -->}}<!-- -->{{#if:{{{3|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{3}}}<!-- -->}}<!-- -->...")
 
 
Line 1: Line 1:
<includeonly><!--
+
<includeonly>{{#invoke:Foreach|w}}</includeonly><noinclude>
-->{{#if:{{{2|}}}|<!-- -->{{<!-- -->{{{1}}}|{{{2}}}<!-- -->}}<!-- -->}}<!--
+
<noinclude>
-->{{#if:{{{3|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{3}}}<!-- -->}}<!-- -->}}<!--
+
<templatedata>
-->{{#if:{{{4|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{4}}}<!-- -->}}<!-- -->}}<!--
+
{
-->{{#if:{{{5|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{5}}}<!-- -->}}<!-- -->}}<!--
+
"params": {
-->{{#if:{{{6|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{6}}}<!-- -->}}<!-- -->}}<!--
+
"templatename": {
-->{{#if:{{{7|}}}|<!-- -->{{{delim|}}}{{<!-- -->{{{1}}}|{{{7}}}<!-- -->}}<!-- -->}}<!--
+
"label": "template name",
-->{{#if:{{{8|}}}|{{{delim|}}}{{{{{1}}}|{{{8}}}}}}}<!-- -->{{#if:{{{9|}}}|{{{delim|}}}{{{{{1}}}|{{{9}}}}}}}<!--
+
"description": "the name of a template that takes at least one parameter. Only the first parameter will be used, so the remaining parameters must be optional."
-->{{#if:{{{10|}}}|{{{delim|}}}{{{{{1}}}|{{{10}}}}}}}<!-- -->{{#if:{{{11|}}}|{{{delim|}}}{{{{{1}}}|{{{11}}}}}}}<!--
+
},
-->{{#if:{{{12|}}}|{{{delim|}}}{{{{{1}}}|{{{12}}}}}}}<!-- -->{{#if:{{{13|}}}|{{{delim|}}}{{{{{1}}}|{{{13}}}}}}}<!--
+
"delim ": {
-->{{#if:{{{14|}}}|{{{delim|}}}{{{{{1}}}|{{{14}}}}}}}<!-- -->{{#if:{{{15|}}}|{{{delim|}}}{{{{{1}}}|{{{15}}}}}}}<!--
+
"label": "delimiter",
-->{{#if:{{{16|}}}|{{{delim|}}}{{{{{1}}}|{{{16}}}}}}}<!-- -->{{#if:{{{17|}}}|{{{delim|}}}{{{{{1}}}|{{{17}}}}}}}<!--
+
"description": "a delimiter that should be inserted between the results of applying the template templatename to the list items; the parameter is compulsory but it can be the empty string"
-->{{#if:{{{18|}}}|{{{delim|}}}{{{{{1}}}|{{{18}}}}}}}<!-- -->{{#if:{{{19|}}}|{{{delim|}}}{{{{{1}}}|{{{19}}}}}}}<!--
+
},
-->{{#if:{{{20|}}}|{{{delim|}}}{{{{{1}}}|{{{20}}}}}}}<!-- -->{{#if:{{{21|}}}|{{{delim|}}}{{{{{1}}}|{{{21}}}}}}}<!--
+
"item...": {
-->{{#if:{{{22|}}}|{{{delim|}}}{{{{{1}}}|{{{22}}}}}}}<!-- -->{{#if:{{{23|}}}|{{{delim|}}}{{{{{1}}}|{{{23}}}}}}}<!--
+
"label": "item",
-->{{#if:{{{24|}}}|{{{delim|}}}{{{{{1}}}|{{{24}}}}}}}<!-- -->{{#if:{{{25|}}}|{{{delim|}}}{{{{{1}}}|{{{25}}}}}}}<!--
+
"description": "the item to pass to the template, resulting in {{templatename|item}}"
-->{{#if:{{{26|}}}|{{{delim|}}}{{{{{1}}}|{{{26}}}}}}}<!-- -->{{#if:{{{27|}}}|{{{delim|}}}{{{{{1}}}|{{{27}}}}}}}<!--
+
}
-->{{#if:{{{28|}}}|{{{delim|}}}{{{{{1}}}|{{{28}}}}}}}<!-- -->{{#if:{{{29|}}}|{{{delim|}}}{{{{{1}}}|{{{29}}}}}}}<!--
+
},
-->{{#if:{{{30|}}}|{{{delim|}}}{{{{{1}}}|{{{30}}}}}}}<!-- -->{{#if:{{{31|}}}|{{{delim|}}}{{{{{1}}}|{{{31}}}}}}}<!--
+
"description": "The purpose of this template is to repeatedly use a template for each argument in a pipe delimited list.\n\nUsage: {{templatename|delim|item1|item2...}}"
-->{{#if:{{{32|}}}|{{{delim|}}}{{{{{1}}}|{{{32}}}}}}}<!-- -->{{#if:{{{33|}}}|{{{delim|}}}{{{{{1}}}|{{{33}}}}}}}<!--
+
}
-->{{#if:{{{34|}}}|{{{delim|}}}{{{{{1}}}|{{{34}}}}}}}<!-- -->{{#if:{{{35|}}}|{{{delim|}}}{{{{{1}}}|{{{35}}}}}}}<!--
+
</templatedata>
-->{{#if:{{{36|}}}|{{{delim|}}}{{{{{1}}}|{{{36}}}}}}}<!-- -->{{#if:{{{37|}}}|{{{delim|}}}{{{{{1}}}|{{{37}}}}}}}<!--
+
</noinclude>
-->{{#if:{{{38|}}}|{{{delim|}}}{{{{{1}}}|{{{38}}}}}}}<!-- -->{{#if:{{{39|}}}|{{{delim|}}}{{{{{1}}}|{{{39}}}}}}}<!--
 
-->{{#if:{{{40|}}}|{{{delim|}}}{{{{{1}}}|{{{40}}}}}}}<!-- -->{{#if:{{{41|}}}|{{{delim|}}}{{{{{1}}}|{{{41}}}}}}}<!--
 
-->{{#if:{{{42|}}}|{{{delim|}}}{{{{{1}}}|{{{42}}}}}}}<!-- -->{{#if:{{{43|}}}|{{{delim|}}}{{{{{1}}}|{{{43}}}}}}}<!--
 
-->{{#if:{{{44|}}}|{{{delim|}}}{{{{{1}}}|{{{44}}}}}}}<!-- -->{{#if:{{{45|}}}|{{{delim|}}}{{{{{1}}}|{{{45}}}}}}}<!--
 
-->{{#if:{{{46|}}}|{{{delim|}}}{{{{{1}}}|{{{46}}}}}}}<!-- -->{{#if:{{{47|}}}|{{{delim|}}}{{{{{1}}}|{{{47}}}}}}}<!--
 
-->{{#if:{{{48|}}}|{{{delim|}}}{{{{{1}}}|{{{48}}}}}}}<!-- -->{{#if:{{{49|}}}|{{{delim|}}}{{{{{1}}}|{{{49}}}}}}}<!--
 
-->{{#if:{{{50|}}}|{{{delim|}}}{{{{{1}}}|{{{50}}}}}}}<!-- -->{{#if:{{{51|}}}|{{{delim|}}}{{{{{1}}}|{{{51}}}}}}}<!--
 
-->{{#if:{{{52|}}}|{{{delim|}}}{{{{{1}}}|{{{52}}}}}}}<!-- -->{{#if:{{{53|}}}|{{{delim|}}}{{{{{1}}}|{{{53}}}}}}}<!--
 
-->{{#if:{{{54|}}}|{{{delim|}}}{{{{{1}}}|{{{54}}}}}}}<!-- -->{{#if:{{{55|}}}|{{{delim|}}}{{{{{1}}}|{{{55}}}}}}}<!--
 
-->{{#if:{{{56|}}}|{{{delim|}}}{{{{{1}}}|{{{56}}}}}}}<!-- -->{{#if:{{{57|}}}|{{{delim|}}}{{{{{1}}}|{{{57}}}}}}}<!--
 
-->{{#if:{{{58|}}}|{{{delim|}}}{{{{{1}}}|{{{58}}}}}}}<!-- -->{{#if:{{{59|}}}|{{{delim|}}}{{{{{1}}}|{{{59}}}}}}}<!--
 
-->{{#if:{{{60|}}}|{{{delim|}}}{{{{{1}}}|{{{60}}}}}}}<!-- -->{{#if:{{{61|}}}|{{{delim|}}}{{{{{1}}}|{{{61}}}}}}}<!--
 
-->{{#if:{{{62|}}}|{{{delim|}}}{{{{{1}}}|{{{62}}}}}}}<!-- -->{{#if:{{{63|}}}|{{{delim|}}}{{{{{1}}}|{{{63}}}}}}}<!--
 
-->{{#if:{{{64|}}}|{{{delim|}}}{{{{{1}}}|{{{64}}}}}}}<!-- -->{{#if:{{{65|}}}|{{{delim|}}}{{{{{1}}}|{{{65}}}}}}}<!--
 
-->{{#if:{{{66|}}}|{{{delim|}}}{{{{{1}}}|{{{66}}}}}}}<!-- -->{{#if:{{{67|}}}|{{{delim|}}}{{{{{1}}}|{{{67}}}}}}}<!--
 
-->{{#if:{{{68|}}}|{{{delim|}}}{{{{{1}}}|{{{68}}}}}}}<!-- -->{{#if:{{{69|}}}|{{{delim|}}}{{{{{1}}}|{{{69}}}}}}}<!--
 
-->{{#if:{{{70|}}}|{{{delim|}}}{{{{{1}}}|{{{70}}}}}}}<!-- -->{{#if:{{{71|}}}|{{{delim|}}}{{{{{1}}}|{{{71}}}}}}}<!--
 
-->{{#if:{{{72|}}}|{{{delim|}}}{{{{{1}}}|{{{72}}}}}}}<!-- -->{{#if:{{{73|}}}|{{{delim|}}}{{{{{1}}}|{{{73}}}}}}}<!--
 
-->{{#if:{{{74|}}}|{{{delim|}}}{{{{{1}}}|{{{74}}}}}}}<!-- -->{{#if:{{{75|}}}|{{{delim|}}}{{{{{1}}}|{{{75}}}}}}}<!--
 
-->{{#if:{{{76|}}}|{{{delim|}}}{{{{{1}}}|{{{76}}}}}}}<!-- -->{{#if:{{{77|}}}|{{{delim|}}}{{{{{1}}}|{{{77}}}}}}}<!--
 
-->{{#if:{{{78|}}}|{{{delim|}}}{{{{{1}}}|{{{78}}}}}}}<!-- -->{{#if:{{{79|}}}|{{{delim|}}}{{{{{1}}}|{{{79}}}}}}}<!--
 
-->{{#if:{{{80|}}}|{{{delim|}}}{{{{{1}}}|{{{80}}}}}}}<!-- -->{{#if:{{{81|}}}|{{{delim|}}}{{{{{1}}}|{{{81}}}}}}}<!--
 
-->{{#if:{{{82|}}}|{{{delim|}}}{{{{{1}}}|{{{82}}}}}}}<!-- -->{{#if:{{{83|}}}|{{{delim|}}}{{{{{1}}}|{{{83}}}}}}}<!--
 
-->{{#if:{{{84|}}}|{{{delim|}}}{{{{{1}}}|{{{84}}}}}}}<!-- -->{{#if:{{{85|}}}|{{{delim|}}}{{{{{1}}}|{{{85}}}}}}}<!--
 
-->{{#if:{{{86|}}}|{{{delim|}}}{{{{{1}}}|{{{86}}}}}}}<!-- -->{{#if:{{{87|}}}|{{{delim|}}}{{{{{1}}}|{{{87}}}}}}}<!--
 
-->{{#if:{{{88|}}}|{{{delim|}}}{{{{{1}}}|{{{88}}}}}}}<!-- -->{{#if:{{{89|}}}|{{{delim|}}}{{{{{1}}}|{{{89}}}}}}}<!--
 
-->{{#if:{{{90|}}}|{{{delim|}}}{{{{{1}}}|{{{90}}}}}}}<!-- -->{{#if:{{{91|}}}|{{{delim|}}}{{{{{1}}}|{{{91}}}}}}}<!--
 
-->{{#if:{{{92|}}}|{{{delim|}}}{{{{{1}}}|{{{92}}}}}}}<!-- -->{{#if:{{{93|}}}|{{{delim|}}}{{{{{1}}}|{{{93}}}}}}}<!--
 
-->{{#if:{{{94|}}}|{{{delim|}}}{{{{{1}}}|{{{94}}}}}}}<!-- -->{{#if:{{{95|}}}|{{{delim|}}}{{{{{1}}}|{{{95}}}}}}}<!--
 
-->{{#if:{{{96|}}}|{{{delim|}}}{{{{{1}}}|{{{96}}}}}}}<!-- -->{{#if:{{{97|}}}|{{{delim|}}}{{{{{1}}}|{{{97}}}}}}}<!--
 
-->{{#if:{{{98|}}}|{{{delim|}}}{{{{{1}}}|{{{98}}}}}}}<!-- -->{{#if:{{{99|}}}|{{{delim|}}}{{{{{1}}}|{{{99}}}}}}}<!--
 
-->{{#if:{{{100|}}}|{{{delim|}}}{{{{{1}}}|{{{100}}}}}}}<!-- -->{{#if:{{{101|}}}|{{{delim|}}}{{{{{1}}}|{{{101}}}}}}}<!--
 
--></includeonly>
 

Latest revision as of 18:14, 23 February 2021


The purpose of this template is to repeatedly use a template for each argument in a pipe delimited list. Usage: {{templatename|delim|item1|item2...}}

Template parameters

ParameterDescriptionTypeStatus
template nametemplatename

the name of a template that takes at least one parameter. Only the first parameter will be used, so the remaining parameters must be optional.

Unknownoptional
delimiterdelim

a delimiter that should be inserted between the results of applying the template templatename to the list items; the parameter is compulsory but it can be the empty string

Unknownoptional
itemitem...

the item to pass to the template, resulting in {{templatename|item}}

Unknownoptional