Difference between revisions of "Template:Enumeration"
(rv. that broke it) |
(Redo with correction: "$number" → "$curr_number") |
||
Line 11: | Line 11: | ||
| | | | ||
| <div class="chronology" lang="{{ #var: $ln | en }}"> | | <div class="chronology" lang="{{ #var: $ln | en }}"> | ||
− | + | {{ #ifexpr: {{ #var: $curr_number }} = 0{{{first|1}}} | |
− | + | | <div class="prev">#{{ #var: $prev_padded }}: <!-- | |
− | + | --><span class="quotes"><!-- | |
− | + | -->{{ #ask: [[{{{2}}}::{{ #var: $prev_padded }}]] | |
− | + | |?{{#var: $lang | English }} name | |
− | + | | format = template | |
− | + | | link = none | |
− | + | | template = pipeLink | |
− | + | }}<!-- | |
− | + | --></span> | |
− | + | </div> | |
− | + | }}{{ #ifexpr: {{ #var: $curr_number }} = 0{{{last|100}}} | |
− | + | | <div class="next">#{{ #var: $next_padded }}: <!-- | |
− | + | --><span class="quotes"><!-- | |
− | + | -->{{ #ask: [[{{{2}}}::{{ #var: $next_padded }}]] | |
− | + | |?{{#var: $lang | English }} name | |
− | + | | format = template | |
− | + | | link = none | |
− | + | | template = pipeLink | |
− | + | }}<!-- | |
+ | --></span> | ||
+ | </div> | ||
+ | }}{{ #if: {{{curr|}}} | ||
+ | |   | ||
<div class="curr">{{{curr}}}</div> }} | <div class="curr">{{{curr}}}</div> }} | ||
</div> | </div> | ||
}} <noinclude>{{documentation}}</noinclude> | }} <noinclude>{{documentation}}</noinclude> |
Revision as of 16:34, 30 October 2013
{{Enumeration}}
is for use in templates using {{card table}}
, where it can be used to create previous and next links through numbered cards.
Usage
{{Enumeration|property|number|number2|first=|last=|curr=|pad=}}
Mandatory parameters:
- property: The first unnamed parameter. This should be the Semantic MediaWiki property, which stores the cards' numbers.
- number: The second unnamed parameter. This should be the number of the current card. If the card has multiple sequential numbers, use the first.
Optional parameters:
- number2: The third unnamed parameter. If the card has multiple sequential numbers, this should be the last of those numbers.
- first: The number of the first card in the sequence. If unused, this defaults to 1. If left blank, it becomes 0.
- last: The number of the last card in the sequence. If unused, this defaults to 100. If left blank, it becomes 0.
- curr: Content to go in the middle "current" section
- pad: The amount of zero-padding to use. This defaults to 3, but leaving it blank, will cause it to become 0.
If this template is used in a non-English tab, the variables $lang
and $ln
should have been created to store the language name and ISO 639-1 code, respectively. If so this will change the language the cards' name appears in and the style of quotation marks used around the name.