https://wiki.xenproject.org/index.php?title=Template:Category_handler/numbered/doc&feed=atom&action=historyTemplate:Category handler/numbered/doc - Revision history2024-03-29T06:43:05ZRevision history for this page on the wikiMediaWiki 1.31.3https://wiki.xenproject.org/index.php?title=Template:Category_handler/numbered/doc&diff=1092&oldid=prevLars.kurth: Created page with "{{documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> This is the {{tl|category handler/numbered}} sub-template. Do not use this te…"2011-11-30T13:00:04Z<p>Created page with "{{documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> This is the {{tl|category handler/numbered}} sub-template. Do not use this te…"</p>
<p><b>New page</b></p><div>{{documentation subpage}}<br />
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --><br />
<br />
This is the {{tl|category handler/numbered}} sub-template.<br />
<br />
Do not use this template directly, use {{tl|category handler}} instead. This template is called from {{tl|category handler}}, see user documentation there.<br />
<br />
The rest of the sections here are only for those that want to understand the internal workings of this template.<br />
<br />
=== Technical details ===<br />
<br />
This sub-template makes it possible for its parent-template to take input in two forms:<br />
<br />
<pre><br />
{{category handler<br />
| 1 = Input<br />
| main = 1<br />
| talk = 1 <!--Reusing "Input" for both the main and talk parameters--><br />
}}<br />
<br />
{{category handler<br />
| main = Input1<br />
| talk = Input2 <!--Instead feeding text directly to the talk parameter--><br />
}}<br />
</pre><br />
<br />
This sub-template takes a bunch of numbered parameters. There's no limit to the number of parameters it can use, other than what the servers and MediaWiki system can handle.<br />
<br />
It also takes a parameter named '''data'''. If '''data''' is a number, then it returns the data of the corresponding numbered parameter. If '''data''' is something else, for instance a category name, then it returns data unchanged.<br />
<br />
Here's how you would normally call this sub-template:<br />
<br />
<pre><br />
{{category handler/numbered<br />
| 1 = {{{1|}}}<br />
| 2 = {{{2|}}}<br />
| 3 = {{{3|}}}<br />
| 4 = {{{4|}}}<br />
| data = Input can be a number between 1-4, or something else.<br />
}}<br />
</pre><br />
<br />
In the above example, since the parent-template feeds only 1-4, then only the numbers 1-4 will work properly. Feeding other numbers will return an empty string.<br />
<br />
<includeonly><br />
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --><br />
</includeonly></div>Lars.kurth