Difference between revisions of "Template:Category handler"
From Ava Zinn Wiki
[unchecked revision] | [unchecked revision] |
(Adding support for "category=empty/no/not defined/¬/yes" for backwards compatibility, to ease deployment. Unfortunately bloating the code.) |
(More efficient code for the "category" parameter. No change in functionality.) |
||
Line 4: | Line 4: | ||
}}{{#ifeq: {{lc: {{{categories|}}} }} | no | }}{{#ifeq: {{lc: {{{categories|}}} }} | no | ||
| dontcat <!--"categories=no", don't categorize--> | | dontcat <!--"categories=no", don't categorize--> | ||
− | }}{{# | + | }}{{#switch: {{lc: {{{category|¬}}} }} |
− | | | + | | no <!--"category = no"--> |
− | | | + | | = dontcat <!--"category =", defined but empty--> |
− | + | }} <!--Else "category = ¬" or not defined or "yes" or other data--> | |
− | + | ||
− | |||
− | |||
− | |||
− | |||
− | |||
| <!--Don't categorise (result was "dontcat" or "dontcatdontcat" and so on)--> | | <!--Don't categorise (result was "dontcat" or "dontcatdontcat" and so on)--> | ||
| <!--If "data" is a number, return the corresponding | | <!--If "data" is a number, return the corresponding |
Revision as of 17:57, 20 November 2009
Template documentation[create]
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |