Template:Iterate/doc: Difference between revisions
More actions
m format |
m syntaxhighlight lang="wikitext" |
||
| (One intermediate revision by one other user not shown) | |||
| Line 15: | Line 15: | ||
|3 =n | |3 =n | ||
|3d-en =number of the changing parameters, 1 ... ''n'' | |3d-en =number of n the changing parameters passed on to the transcluted template on the first n paramter positions, 1 ... ''n'' | ||
|3def =2 | |3def =2 | ||
|3stat =optional- | |3stat =optional- | ||
|4 =p{{sub|1}} ... p{{sub|8}} | |4 =p{{sub|1}} ... p{{sub|8}} | ||
|4d-en =all the not-changing parameters | |4d-en =all the not-changing parameters passed on to the transcluted template after the first n positions | ||
|4stat =optional- | |4stat =optional- | ||
| Line 66: | Line 66: | ||
With: < | With: <syntaxhighlight lang="wikitext">{{ Iterate | ||
|Pink check.svg| | | Pink check.svg | | ||
|Purple check.svg| | | Purple check.svg | | ||
|Yellow check.svg| | | Yellow check.svg | | ||
|White check.svg|b | | White check.svg | b | ||
|Red check.svg| | | Red check.svg | | ||
|p2=Z|p1=32}}</ | | p2=Z | p1=32 }}</syntaxhighlight> | ||
(default for <code>t=F</code> and <code>n=2</code>)<br> | (default for <code>t=F</code> and <code>n=2</code>)<br> | ||
<syntaxhighlight lang="wikitext"> | |||
{{ F | Pink check.svg | | 32 | Z }} | |||
{{ F | Purple check.svg | | 32 | Z }} | |||
{{ F | Yellow check.svg | | 32 | Z }} | |||
{{ F | White check.svg | b | 32 | Z }} | |||
{{ F | Red check.svg | | 32 | Z }} | |||
</syntaxhighlight> | |||
these five files are shown: | these five files are shown: | ||
{{Iterate | {{Iterate | ||
|Pink check.svg| | | Pink check.svg | | ||
|Purple check.svg| | | Purple check.svg | | ||
|Yellow check.svg| | | Yellow check.svg | | ||
|White check.svg|b | | White check.svg | b | ||
|Red check.svg| | | Red check.svg | | ||
|p1=32 | | p2=Z| p1=32 }} | ||
;Note:: With {{Tle|T=Filelist|p1=d|32|p2=o|Z|p3=c|n|p4=q4|b|Pink check.svg|Purple check.svg|Yellow check.svg|White check.svg|Red check.svg}} | ;Note:: With {{Tle|T=Filelist|p1=d|32|p2=o|Z|p3=c|n|p4=q4|b|Pink check.svg|Purple check.svg|Yellow check.svg|White check.svg|Red check.svg}} | ||
the same display is shown: {{Filelist|Pink check.svg|Purple check.svg|Yellow check.svg|White check.svg|Red check.svg|d=32|o=Z|c=n|q4=b}} | the same display is shown: {{Filelist|Pink check.svg|Purple check.svg|Yellow check.svg|White check.svg|Red check.svg|d=32|o=Z|c=n|q4=b}} | ||
Latest revision as of 07:10, 3 June 2023
Iteration template with a number of parameters changing for each transclusion, and more parameters always the same for all transclusions
Usage
{{Iterate |1= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | 1 ... x Parameters, e.g. filenames | empty | suggested | |
t | Name of the iterated template | {{F}} | optional | |
n | number of n the changing parameters passed on to the transcluted template on the first n paramter positions, 1 ... n | 2 | optional | |
p1 ... p8 | all the not-changing parameters passed on to the transcluted template after the first n positions | empty | optional | |
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.
Explanation
A template (t) is transcuded, with positional parameters
- a tupel of (n) parameters changing for each transclusion, and
- a number of not changing additional parameter values.
Example
for e.g. n=3: With {{ Iterate | t = template | n = 3
| a | b | c
| u | v | w
| r | s | t
| x | y | z
| p1 = c1 | p2 = c2 | ... | p8 = c8 }}
the template template will be transcluded 4 times, with the parameters
- {{
template| a | b | c | c1 | c2 | ... | c8 }} - {{
template| u | v | w | c1 | c2 | ... | c8 }} - {{
template| r | s | t | c1 | c2 | ... | c8 }} - {{
template| x | y | z | c1 | c2 | ... | c8 }}
The tupel-number n can be any value 1,2, ...; this example schows a tripel.
The number of the tupels, in the example 4, is not limited.
The additional values are currently limited to 8, therefore 0 ...8 values can be specified.
With:
{{ Iterate
| Pink check.svg |
| Purple check.svg |
| Yellow check.svg |
| White check.svg | b
| Red check.svg |
| p2=Z | p1=32 }}
(default for t=F and n=2)
{{ F | Pink check.svg | | 32 | Z }}
{{ F | Purple check.svg | | 32 | Z }}
{{ F | Yellow check.svg | | 32 | Z }}
{{ F | White check.svg | b | 32 | Z }}
{{ F | Red check.svg | | 32 | Z }}
- Note:
- With {{ Filelist | d = 32 | o = Z | c = n | q4 = b | Pink check.svg | Purple check.svg | Yellow check.svg | White check.svg | Red check.svg }}