Template:For: Difference between revisions
More actions
No edit summary |
change c to forcall to avoid conflict with possible user par |
||
| Line 1: | Line 1: | ||
{{{{{substfa|}}}for/aux|{{{1}}}|subst={{{substa|}}}|substc={{{substc|}}}| | {{{{{substfa|}}}for/aux|{{{1}}}|subst={{{substa|}}}|substc={{{substc|}}}|forcall={{{call}}}|empty=|pv={{{{{substf|}}}#ifeq:{{{pv|+}}}|{{{pv|-}}}|{{{pv}}}|1}}|prefix={{{{{substf|}}}#ifeq:{{{prefix|+}}}|{{{prefix|-}}}|{{{prefix}}}}}|postfix={{{{{substf|}}}#ifeq:{{{postfix|+}}}|{{{postfix|-}}}|{{{postfix}}}}}|pc1={{{{{substf|}}}#ifeq:{{{pc1|+}}}|{{{pc1|-}}}|{{{pc1}}}|=}}|pc2={{{{{substf|}}}#ifeq:{{{pc2|+}}}|{{{pc2|-}}}|{{{pc2}}}|=}}|pc3={{{{{substf|}}}#ifeq:{{{pc3|+}}}|{{{pc3|-}}}|{{{pc3}}}|=}}|pc4={{{{{substf|}}}#ifeq:{{{pc4|+}}}|{{{pc4|-}}}|{{{pc4}}}|=}}|{{{{{substf|}}}#ifeq:{{{2|+}}}|{{{2|-}}}|{{{2}}}|=}}|{{{{{substf|}}}#ifeq:{{{3|+}}}|{{{3|-}}}|{{{3}}}|=}}|{{{{{substf|}}}#ifeq:{{{4|+}}}|{{{4|-}}}|{{{4}}}|=}}|{{{{{substf|}}}#ifeq:{{{5|+}}}|{{{5|-}}}|{{{5}}}|=}}|{{{{{substf|}}}#ifeq:{{{6|+}}}|{{{6|-}}}|{{{6}}}|=}}|{{{{{substf|}}}#ifeq:{{{7|+}}}|{{{7|-}}}|{{{7}}}|=}}|{{{{{substf|}}}#ifeq:{{{8|+}}}|{{{8|-}}}|{{{8}}}|=}}|{{{{{substf|}}}#ifeq:{{{9|+}}}|{{{9|-}}}|{{{9}}}|=}}|{{{{{substf|}}}#ifeq:{{{10|+}}}|{{{10|-}}}|{{{10}}}|=}}|{{{{{substf|}}}#ifeq:{{{11|+}}}|{{{11|-}}}|{{{11}}}|=}}|{{{{{substf|}}}#ifeq:{{{12|+}}}|{{{12|-}}}|{{{12}}}|=}}|{{{{{substf|}}}#ifeq:{{{13|+}}}|{{{13|-}}}|{{{13}}}|=}}|{{{{{substf|}}}#ifeq:{{{14|+}}}|{{{14|-}}}|{{{14}}}|=}}|{{{{{substf|}}}#ifeq:{{{15|+}}}|{{{15|-}}}|{{{15}}}|=}}|{{{{{substf|}}}#ifeq:{{{16|+}}}|{{{16|-}}}|{{{16}}}|=}}|{{{{{substf|}}}#ifeq:{{{17|+}}}|{{{17|-}}}|{{{17}}}|=}}|{{{{{substf|}}}#ifeq:{{{18|+}}}|{{{18|-}}}|{{{18}}}|=}}|{{{{{substf|}}}#ifeq:{{{19|+}}}|{{{19|-}}}|{{{19}}}|=}}|{{{{{substf|}}}#ifeq:{{{20|+}}}|{{{20|-}}}|{{{20}}}|=}}|{{{{{substf|}}}#ifeq:{{{21|+}}}|{{{21|-}}}|{{{21}}}|=}}|{{{{{substf|}}}#ifeq:{{{22|+}}}|{{{22|-}}}|{{{22}}}|=}}|{{{{{substf|}}}#ifeq:{{{23|+}}}|{{{23|-}}}|{{{23}}}|=}}|{{{{{substf|}}}#ifeq:{{{24|+}}}|{{{24|-}}}|{{{24}}}|=}}|{{{{{substf|}}}#ifeq:{{{25|+}}}|{{{25|-}}}|{{{25}}}|=}}|{{{{{substf|}}}#ifeq:{{{26|+}}}|{{{26|-}}}|{{{26}}}|=}}|{{{{{substf|}}}#ifeq:{{{27|+}}}|{{{27|-}}}|{{{27}}}|=}}|{{{{{substf|}}}#ifeq:{{{28|+}}}|{{{28|-}}}|{{{28}}}|=}}|{{{{{substf|}}}#ifeq:{{{29|+}}}|{{{29|-}}}|{{{29}}}|=}}|{{{{{substf|}}}#ifeq:{{{30|+}}}|{{{30|-}}}|{{{30}}}|=}}|{{{{{substf|}}}#ifeq:{{{31|+}}}|{{{31|-}}}|{{{31}}}|=}}|{{{{{substf|}}}#ifeq:{{{32|+}}}|{{{32|-}}}|{{{32}}}|=}}|{{{{{substf|}}}#ifeq:{{{33|+}}}|{{{33|-}}}|{{{33}}}|=}}|{{{{{substf|}}}#ifeq:{{{34|+}}}|{{{34|-}}}|{{{34}}}|=}}|{{{{{substf|}}}#ifeq:{{{35|+}}}|{{{35|-}}}|{{{35}}}|=}}|{{{{{substf|}}}#ifeq:{{{36|+}}}|{{{36|-}}}|{{{36}}}|=}}|{{{{{substf|}}}#ifeq:{{{37|+}}}|{{{37|-}}}|{{{37}}}|=}}|{{{{{substf|}}}#ifeq:{{{38|+}}}|{{{38|-}}}|{{{38}}}|=}}|{{{{{substf|}}}#ifeq:{{{39|+}}}|{{{39|-}}}|{{{39}}}|=}}|{{{{{substf|}}}#ifeq:{{{40|+}}}|{{{40|-}}}|{{{40}}}|=}}|{{{{{substf|}}}#ifeq:{{{41|+}}}|{{{41|-}}}|{{{41}}}|=}}|{{{{{substf|}}}#ifeq:{{{42|+}}}|{{{42|-}}}|{{{42}}}|=}}|{{{{{substf|}}}#ifeq:{{{43|+}}}|{{{43|-}}}|{{{43}}}|=}}|{{{{{substf|}}}#ifeq:{{{44|+}}}|{{{44|-}}}|{{{44}}}|=}}|{{{{{substf|}}}#ifeq:{{{45|+}}}|{{{45|-}}}|{{{45}}}|=}}|{{{{{substf|}}}#ifeq:{{{46|+}}}|{{{46|-}}}|{{{46}}}|=}}|{{{{{substf|}}}#ifeq:{{{47|+}}}|{{{47|-}}}|{{{47}}}|=}}|{{{{{substf|}}}#ifeq:{{{48|+}}}|{{{48|-}}}|{{{48}}}|=}}|{{{{{substf|}}}#ifeq:{{{49|+}}}|{{{49|-}}}|{{{49}}}|=}}|{{{{{substf|}}}#ifeq:{{{50|+}}}|{{{50|-}}}|{{{50}}}|=}}|{{{{{substf|}}}#ifeq:{{{51|+}}}|{{{51|-}}}|{{{51}}}|=}}|{{{{{substf|}}}#ifeq:{{{52|+}}}|{{{52|-}}}|{{{52}}}|=}}|{{{{{substf|}}}#ifeq:{{{53|+}}}|{{{53|-}}}|{{{53}}}|=}}|{{{{{substf|}}}#ifeq:{{{54|+}}}|{{{54|-}}}|{{{54}}}|=}}|{{{{{substf|}}}#ifeq:{{{55|+}}}|{{{55|-}}}|{{{55}}}|=}}|{{{{{substf|}}}#ifeq:{{{56|+}}}|{{{56|-}}}|{{{56}}}|=}}|{{{{{substf|}}}#ifeq:{{{57|+}}}|{{{57|-}}}|{{{57}}}|=}}|{{{{{substf|}}}#ifeq:{{{58|+}}}|{{{58|-}}}|{{{58}}}|=}}|{{{{{substf|}}}#ifeq:{{{59|+}}}|{{{59|-}}}|{{{59}}}|=}}|{{{{{substf|}}}#ifeq:{{{60|+}}}|{{{60|-}}}|{{{60}}}|=}}|{{{{{substf|}}}#ifeq:{{{61|+}}}|{{{61|-}}}|{{{61}}}|=}}|{{{{{substf|}}}#ifeq:{{{62|+}}}|{{{62|-}}}|{{{62}}}|=}}|{{{{{substf|}}}#ifeq:{{{63|+}}}|{{{63|-}}}|{{{63}}}|=}}|{{{{{substf|}}}#ifeq:{{{64|+}}}|{{{64|-}}}|{{{64}}}|=}}|{{{{{substf|}}}#ifeq:{{{65|+}}}|{{{65|-}}}|{{{65}}}|=}}|{{{{{substf|}}}#ifeq:{{{66|+}}}|{{{66|-}}}|{{{66}}}|=}}|{{{{{substf|}}}#ifeq:{{{67|+}}}|{{{67|-}}}|{{{67}}}|=}}|{{{{{substf|}}}#ifeq:{{{68|+}}}|{{{68|-}}}|{{{68}}}|=}}|{{{{{substf|}}}#ifeq:{{{69|+}}}|{{{69|-}}}|{{{69}}}|=}}|{{{{{substf|}}}#ifeq:{{{70|+}}}|{{{70|-}}}|{{{70}}}|=}}|{{{{{substf|}}}#ifeq:{{{71|+}}}|{{{71|-}}}|{{{71}}}|=}}|{{{{{substf|}}}#ifeq:{{{72|+}}}|{{{72|-}}}|{{{72}}}|=}}|{{{{{substf|}}}#ifeq:{{{73|+}}}|{{{73|-}}}|{{{73}}}|=}}|{{{{{substf|}}}#ifeq:{{{74|+}}}|{{{74|-}}}|{{{74}}}|=}}|{{{{{substf|}}}#ifeq:{{{75|+}}}|{{{75|-}}}|{{{75}}}|=}}|{{{{{substf|}}}#ifeq:{{{76|+}}}|{{{76|-}}}|{{{76}}}|=}}|{{{{{substf|}}}#ifeq:{{{77|+}}}|{{{77|-}}}|{{{77}}}|=}}|{{{{{substf|}}}#ifeq:{{{78|+}}}|{{{78|-}}}|{{{78}}}|=}}|{{{{{substf|}}}#ifeq:{{{79|+}}}|{{{79|-}}}|{{{79}}}|=}}|{{{{{substf|}}}#ifeq:{{{80|+}}}|{{{80|-}}}|{{{80}}}|=}}|{{{{{substf|}}}#ifeq:{{{81|+}}}|{{{81|-}}}|{{{81}}}|=}}|{{{{{substf|}}}#ifeq:{{{82|+}}}|{{{82|-}}}|{{{82}}}|=}}|{{{{{substf|}}}#ifeq:{{{83|+}}}|{{{83|-}}}|{{{83}}}|=}}|{{{{{substf|}}}#ifeq:{{{84|+}}}|{{{84|-}}}|{{{84}}}|=}}|{{{{{substf|}}}#ifeq:{{{85|+}}}|{{{85|-}}}|{{{85}}}|=}}|{{{{{substf|}}}#ifeq:{{{86|+}}}|{{{86|-}}}|{{{86}}}|=}}|{{{{{substf|}}}#ifeq:{{{87|+}}}|{{{87|-}}}|{{{87}}}|=}}|{{{{{substf|}}}#ifeq:{{{88|+}}}|{{{88|-}}}|{{{88}}}|=}}|{{{{{substf|}}}#ifeq:{{{89|+}}}|{{{89|-}}}|{{{89}}}|=}}|{{{{{substf|}}}#ifeq:{{{90|+}}}|{{{90|-}}}|{{{90}}}|=}}|{{{{{substf|}}}#ifeq:{{{91|+}}}|{{{91|-}}}|{{{91}}}|=}}|{{{{{substf|}}}#ifeq:{{{92|+}}}|{{{92|-}}}|{{{92}}}|=}}|{{{{{substf|}}}#ifeq:{{{93|+}}}|{{{93|-}}}|{{{93}}}|=}}|{{{{{substf|}}}#ifeq:{{{94|+}}}|{{{94|-}}}|{{{94}}}|=}}|{{{{{substf|}}}#ifeq:{{{95|+}}}|{{{95|-}}}|{{{95}}}|=}}|{{{{{substf|}}}#ifeq:{{{96|+}}}|{{{96|-}}}|{{{96}}}|=}}|{{{{{substf|}}}#ifeq:{{{97|+}}}|{{{97|-}}}|{{{97}}}|=}}|{{{{{substf|}}}#ifeq:{{{98|+}}}|{{{98|-}}}|{{{98}}}|=}}|{{{{{substf|}}}#ifeq:{{{99|+}}}|{{{99|-}}}|{{{99}}}|=}}|{{{{{substf|}}}#ifeq:{{{100|+}}}|{{{100|-}}}|{{{100}}}|=}}|{{{{{substf|}}}#ifeq:{{{101|+}}}|{{{101|-}}}|{{{101}}}|=}}|{{{{{substf|}}}#ifeq:{{{102|+}}}|{{{102|-}}}|{{{102}}}|=}}|{{{{{substf|}}}#ifeq:{{{103|+}}}|{{{103|-}}}|{{{103}}}|=}}|{{{{{substf|}}}#ifeq:{{{104|+}}}|{{{104|-}}}|{{{104}}}|=}}|{{{{{substf|}}}#ifeq:{{{105|+}}}|{{{105|-}}}|{{{105}}}|=}}|{{{{{substf|}}}#ifeq:{{{106|+}}}|{{{106|-}}}|{{{106}}}|=}}|{{{{{substf|}}}#ifeq:{{{107|+}}}|{{{107|-}}}|{{{107}}}|=}}|{{{{{substf|}}}#ifeq:{{{108|+}}}|{{{108|-}}}|{{{108}}}|=}}|{{{{{substf|}}}#ifeq:{{{109|+}}}|{{{109|-}}}|{{{109}}}|=}}|{{{{{substf|}}}#ifeq:{{{110|+}}}|{{{110|-}}}|{{{110}}}|=}}|{{{{{substf|}}}#ifeq:{{{111|+}}}|{{{111|-}}}|{{{111}}}|=}}|{{{{{substf|}}}#ifeq:{{{112|+}}}|{{{112|-}}}|{{{112}}}|=}}|{{{{{substf|}}}#ifeq:{{{113|+}}}|{{{113|-}}}|{{{113}}}|=}}|{{{{{substf|}}}#ifeq:{{{114|+}}}|{{{114|-}}}|{{{114}}}|=}}|{{{{{substf|}}}#ifeq:{{{115|+}}}|{{{115|-}}}|{{{115}}}|=}}|{{{{{substf|}}}#ifeq:{{{116|+}}}|{{{116|-}}}|{{{116}}}|=}}|{{{{{substf|}}}#ifeq:{{{117|+}}}|{{{117|-}}}|{{{117}}}|=}}|{{{{{substf|}}}#ifeq:{{{118|+}}}|{{{118|-}}}|{{{118}}}|=}}|{{{{{substf|}}}#ifeq:{{{119|+}}}|{{{119|-}}}|{{{119}}}|=}}|{{{{{substf|}}}#ifeq:{{{120|+}}}|{{{120|-}}}|{{{120}}}|=}}|{{{{{substf|}}}#ifeq:{{{121|+}}}|{{{121|-}}}|{{{121}}}|=}}|{{{{{substf|}}}#ifeq:{{{122|+}}}|{{{122|-}}}|{{{122}}}|=}}|{{{{{substf|}}}#ifeq:{{{123|+}}}|{{{123|-}}}|{{{123}}}|=}}|{{{{{substf|}}}#ifeq:{{{124|+}}}|{{{124|-}}}|{{{124}}}|=}}|{{{{{substf|}}}#ifeq:{{{125|+}}}|{{{125|-}}}|{{{125}}}|=}}|{{{{{substf|}}}#ifeq:{{{126|+}}}|{{{126|-}}}|{{{126}}}|=}}|{{{{{substf|}}}#ifeq:{{{127|+}}}|{{{127|-}}}|{{{127}}}|=}}|{{{{{substf|}}}#ifeq:{{{128|+}}}|{{{128|-}}}|{{{128}}}|=}}|{{{{{substf|}}}#ifeq:{{{129|+}}}|{{{129|-}}}|{{{129}}}|=}}|{{{{{substf|}}}#ifeq:{{{130|+}}}|{{{130|-}}}|{{{130}}}|=}}|{{{{{substf|}}}#ifeq:{{{131|+}}}|{{{131|-}}}|{{{131}}}|=}}|{{{{{substf|}}}#ifeq:{{{132|+}}}|{{{132|-}}}|{{{132}}}|=}}|{{{{{substf|}}}#ifeq:{{{133|+}}}|{{{133|-}}}|{{{133}}}|=}}|{{{{{substf|}}}#ifeq:{{{134|+}}}|{{{134|-}}}|{{{134}}}|=}}|{{{{{substf|}}}#ifeq:{{{135|+}}}|{{{135|-}}}|{{{135}}}|=}}|{{{{{substf|}}}#ifeq:{{{136|+}}}|{{{136|-}}}|{{{136}}}|=}}|{{{{{substf|}}}#ifeq:{{{137|+}}}|{{{137|-}}}|{{{137}}}|=}}|{{{{{substf|}}}#ifeq:{{{138|+}}}|{{{138|-}}}|{{{138}}}|=}}|{{{{{substf|}}}#ifeq:{{{139|+}}}|{{{139|-}}}|{{{139}}}|=}}|{{{{{substf|}}}#ifeq:{{{140|+}}}|{{{140|-}}}|{{{140}}}|=}}|{{{{{substf|}}}#ifeq:{{{141|+}}}|{{{141|-}}}|{{{141}}}|=}}|{{{{{substf|}}}#ifeq:{{{142|+}}}|{{{142|-}}}|{{{142}}}|=}}|{{{{{substf|}}}#ifeq:{{{143|+}}}|{{{143|-}}}|{{{143}}}|=}}|{{{{{substf|}}}#ifeq:{{{144|+}}}|{{{144|-}}}|{{{144}}}|=}}|{{{{{substf|}}}#ifeq:{{{145|+}}}|{{{145|-}}}|{{{145}}}|=}}|{{{{{substf|}}}#ifeq:{{{146|+}}}|{{{146|-}}}|{{{146}}}|=}}|{{{{{substf|}}}#ifeq:{{{147|+}}}|{{{147|-}}}|{{{147}}}|=}}|{{{{{substf|}}}#ifeq:{{{148|+}}}|{{{148|-}}}|{{{148}}}|=}}|{{{{{substf|}}}#ifeq:{{{149|+}}}|{{{149|-}}}|{{{149}}}|=}}|{{{{{substf|}}}#ifeq:{{{150|+}}}|{{{150|-}}}|{{{150}}}|=}}|{{{{{substf|}}}#ifeq:{{{151|+}}}|{{{151|-}}}|{{{151}}}|=}}}}<noinclude>{{documentation}}</noinclude> | ||
Revision as of 11:01, 16 November 2007
The template calls a specified template several times, where one parameter takes each of a list of values; in addition to the variable parameter, for up to 4 parameters a fixed value can be specified.
Usage
{{for
|1 =
|call =
|pc1n =
|pc1v =
|pc2n =
|pc2v =
|pc3n =
|pc3v =
|pc4n =
|pc4v =
|pv =
|prefix =
|postfix =
|2 =
}}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | separator | What to separate entries with | empty | suggested |
call | template | The template to call in each iteration | void | required |
pc1n | constant parameter 1 | The first constant parameter’s name | empty | optional |
pc1v | constant value 1 | The first constant parameter’s value | empty | optional |
pc2n | constant parameter 2 | The second constant parameter’s name | empty | optional |
pc2v | constant value 2 | The second constant parameter’s value | empty | optional |
pc3n | constant parameter 3 | The third constant parameter’s name | empty | optional |
pc3v | constant value 3 | The third constant parameter’s value | empty | optional |
pc4n | constant parameter 4 | The fourth constant parameter’s name | empty | optional |
pc4v | constant value 4 | The fourth constant parameter’s value | empty | optional |
pv | variable parameter | The variable parameter’s name | 1 | optional |
prefix | variable prefix | Constant prefix of the variable parameter’s value | empty | optional |
postfix | variable postfix | Constant postfix of the variable parameter’s value | empty | optional |
23 4 … | variable parameters | The variable parameters’ values. Each value goes in its own parameter, starting with parameter 2. | empty | required |
Additional information
The template is intended to be used in the following namespaces: no namespace specified
The template is intended to be used by the following user groups: no user group specified
Localization
This template is not intended to be localized.
Example
| Code | Result |
|---|---|
List of all numbers from 100 to 199, separated by commas:1{{for|, 1|call=x1
|00|01|02|03|04|05|06|07|08|09
|10|11|12|13|14|15|16|17|18|19
|20|21|22|23|24|25|26|27|28|29
|30|31|32|33|34|35|36|37|38|39
|40|41|42|43|44|45|46|47|48|49
|50|51|52|53|54|55|56|57|58|59
|60|61|62|63|64|65|66|67|68|69
|70|71|72|73|74|75|76|77|78|79
|80|81|82|83|84|85|86|87|88|89
|90|91|92|93|94|95|96|97|98|99
}}
|1{{for|, 1|call=x1 |00|01|02|03|04|05|06|07|08|09 |10|11|12|13|14|15|16|17|18|19 |20|21|22|23|24|25|26|27|28|29 |30|31|32|33|34|35|36|37|38|39 |40|41|42|43|44|45|46|47|48|49 |50|51|52|53|54|55|56|57|58|59 |60|61|62|63|64|65|66|67|68|69 |70|71|72|73|74|75|76|77|78|79 |80|81|82|83|84|85|86|87|88|89 |90|91|92|93|94|95|96|97|98|99 }} | |
An example used in {{Facts/Major cities}}:{{for||pc1n=decade|pc1v={{{2|{{{decade|}}}}}}|call=Facts/placeParts
|Amsterdam|Bangkok|Barcelona|Beijing|Berlin|Brussels|Buenos Aires|Cairo|Canton|Cape Town|Chicago|Delhi|Dubai|Frankfurt am Main|Geneva|Hong Kong|Istanbul|Jerusalem|Kolkata|Lagos, Nigeria|London|Los Angeles|Madrid|Mexico City|Moscow|Mumbai|Nairobi|New York City|Osaka|Paris|Rio de Janeiro (city)|Rome|São Paulo (city)|San Francisco|Seoul|Shanghai|Singapore|Stockholm|Sydney|Tokyo|Toronto|Washington, D.C.|Wuhan}}
|{{for||pc1n=decade|pc1v={{{2|{{{decade|}}}}}}|call=Facts/placeParts |Amsterdam|Bangkok|Barcelona|Beijing|Berlin|Brussels|Buenos Aires|Cairo|Canton|Cape Town|Chicago|Delhi|Dubai|Frankfurt am Main|Geneva|Hong Kong|Istanbul|Jerusalem|Kolkata|Lagos, Nigeria|London|Los Angeles|Madrid|Mexico City|Moscow|Mumbai|Nairobi|New York City|Osaka|Paris|Rio de Janeiro (city)|Rome|São Paulo (city)|San Francisco|Seoul|Shanghai|Singapore|Stockholm|Sydney|Tokyo|Toronto|Washington, D.C.|Wuhan}} |
Note that the last part of the separator is used as a prefix; the first prefix needs to be put separately.