Anonymous user
Template:Category handler: Difference between revisions
Making this template backwards compatible by adding support for "categories=no/yes", to ease deployment.
(Using a #switch-case for the blacklist check, to make it easier to add more blacklist functions in the future.) |
(Making this template backwards compatible by adding support for "categories=no/yes", to ease deployment.) |
||
Line 1:
{{#ifeq: {{lc: {{{nocat|}}} }} | true
| <!--"nocat=true", don't categorize-->
| <!--If "data" is a number, return the corresponding ▼
|
▲ | <!--If "data" is a number, return the corresponding
{{cat handler/numbered▼
numbered parameter, else return "data"-->
| 1 = {{{1|}}}▼
▲ {{cat handler/numbered
|
|
|
|
|
|
|
|
|
| 10 = {{
▲ {{#ifeq: {{lc: {{{nocat|}}} }} | false
{{#switch:
| <!--"nocat=false", force categorize, skip blacklist check-->▼
| hide = <!--Blacklist returned "hide", don't categorize-->▼
| <!--"categories=yes", skip blacklist check-->
▲ | #default =
| {{cat handler/blacklist| page = {{{page|}}} }} <!--Check blacklist-->
<!--Check what namespace, and return the data for it-->▼
▲ | hide = <!--Blacklist returned "hide", don't categorize-->
| talk = {{{talk| {{{other|}}} }}}▼
|
▲ <!--Check what namespace, and return the data for it-->
| wikipedia = {{{wikipedia| {{{project| {{{other|}}} }}} }}}▼
{{namespace detect
▲ | file = {{{file| {{{image| {{{other| 1 }}} }}} }}}
|
|
|
|
|
|
|
| portal = {{{portal| {{{other| 1 }}} }}}
| other = {{{other|}}} <!--Namespace special or a new namespace-->
| page = {{{page|}}} <!--For testing and demonstration-->
}}
}}
|