வார்ப்புரு:Cat handler
{{#if:
   {{#ifeq: {{lc: {{{nocat|}}} }} | true
   | dontcat    &lt;!--&quot;nocat=true&quot;, don't categorize--&gt;
   }}{{#ifeq: {{lc: {{{categories|}}} }} | no
   | dontcat
   }}{{#switch: {{lc: {{{category2|¬}}} }}
   | yes
   | ¬   =   &lt;!--Not defined--&gt;
   | #default = dontcat   &lt;!--&quot;category2 = no/'defined but empty'/'anything'&quot;--&gt;
   }}{{#switch: {{lc: {{{subpage|}}} }}
   | no = 
     {{basepage subpage
     | 
     | dontcat    &lt;!--&quot;subpage=no&quot; and on a subpage--&gt;
     | page = {{{page|}}}   &lt;!--For testing--&gt;
     }}
   | only = 
     {{basepage subpage
     | dontcat    &lt;!--&quot;subpage=only&quot; and not on a subpage--&gt;
     | page = {{{page|}}}   &lt;!--For testing--&gt;
     }}
   }}
 
 |   &lt;!--Don't categorise (result was &quot;dontcat&quot; or &quot;dontcatdontcat&quot; and so on)--&gt;
 | &lt;!--Check blacklist--&gt;
   {{#switch:
     {{#ifeq: {{lc: {{{nocat|}}} }} | false
     |   &lt;!--&quot;nocat=false&quot;, skip blacklist check--&gt;
     | {{#ifeq: {{lc: {{{categories|}}} }} | yes
       |   &lt;!--Skip blacklist check--&gt;
       | {{#ifeq: {{lc: {{{category2|}}} }} | yes
         |   &lt;!--Skip blacklist check--&gt;
         | 
         }}
       }}
     }}
   | hide = &lt;!--Blacklist returned &quot;hide&quot;, don't categorize--&gt;
   | #default  = 
     &lt;!--Check if any namespace parameter is defined--&gt;
     {{#ifeq: h0#384!5nea+w9 | {{{all| {{{main| {{{talk| {{{user| {{{wikipedia| {{{file| {{{mediawiki| {{{template| {{{help| {{{category| {{{portal| {{{book| {{{other| h0#384!5nea+w9 }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}}
     | &lt;!--No namespace parameters fed, basic usage--&gt;
       {{namespace detect
       | main = {{{1|}}}
       | file = {{{1|}}}
       | help = {{{1|}}}
       | category = {{{1|}}}
       | portal = {{{1|}}}
       | book = {{{1|}}}
       | page = {{{page|}}}   &lt;!--For testing and demonstration--&gt;
       }}
     | &lt;!--Namespace parameters fed, advanced usage.
           If &quot;data&quot; is a number, return the corresponding 
           numbered parameter, else return &quot;data&quot;.  --&gt;
       {{{all|}}}{{cat handler/numbered
       | 1 = {{{1|}}}
       | 2 = {{{2|}}}
       | 3 = {{{3|}}}
       | 4 = {{{4|}}}
       | 5 = {{{5|}}}
       | 6 = {{{6|}}}
       | 7 = {{{7|}}}
       | 8 = {{{8|}}}
       | 9 = {{{9|}}}
       | 10 = {{{10|}}}
       | data = 
         &lt;!--Check what namespace, and return the data for it.
             Respecting empty parameters on purpose.  --&gt;
         {{namespace detect
         | main = {{{main| {{{other|}}} }}}
         | talk = {{{talk| {{{other|}}} }}}
         | user = {{{user| {{{other|}}} }}}
         | wikipedia = {{{wikipedia| {{{project| {{{other|}}} }}} }}}
         | file = {{{file| {{{image| {{{other|}}} }}} }}}
         | mediawiki = {{{mediawiki| {{{other|}}} }}}
         | template = {{{template| {{{other|}}} }}}
         | help = {{{help| {{{other|}}} }}}
         | category = {{{category| {{{other|}}} }}}
         | portal = {{{portal| {{{other|}}} }}}
         | book = {{{book| {{{other|}}} }}}
         | other = {{{other|}}}  &lt;!--Namespace special or a new namespace--&gt;
         | page = {{{page|}}}   &lt;!--For testing and demonstration--&gt;
         }}
       }}
     }}
   }}