Difference between revisions of "Template:Cat handler"

From Self-sufficiency
Jump to: navigation, search
(Adding "category2 =" support, to work around the "category" parameter name collision. Keeping "category =" support for some hours while fixing any usage out there.)
m (1 revision)
 
(7 intermediate revisions by 4 users not shown)
Line 4: Line 4:
 
   }}{{#ifeq: {{lc: {{{categories|}}} }} | no
 
   }}{{#ifeq: {{lc: {{{categories|}}} }} | no
 
   | dontcat
 
   | dontcat
  }}{{#switch: {{lc: {{{category|¬}}} }}
 
  | no
 
  |    = dontcat  <!--"category =", defined but empty-->
 
      <!--Else "category = ¬/'not defined'/yes/'anything'"-->
 
 
   }}{{#switch: {{lc: {{{category2|¬}}} }}
 
   }}{{#switch: {{lc: {{{category2|¬}}} }}
 
   | yes
 
   | yes
 
   | ¬  =  <!--Not defined-->
 
   | ¬  =  <!--Not defined-->
   | #default = dontcat  <!--"category = no/'defined but empty'/'anything'"-->
+
   | #default = dontcat  <!--"category2 = no/'defined but empty'/'anything'"-->
 
   }}{{#switch: {{lc: {{{subpage|}}} }}
 
   }}{{#switch: {{lc: {{{subpage|}}} }}
 
   | no =  
 
   | no =  
Line 33: Line 29:
 
     | {{#ifeq: {{lc: {{{categories|}}} }} | yes
 
     | {{#ifeq: {{lc: {{{categories|}}} }} | yes
 
       |  <!--Skip blacklist check-->
 
       |  <!--Skip blacklist check-->
       | {{#ifeq: {{lc: {{{category|}}} }} | yes
+
       | {{#ifeq: {{lc: {{{category2|}}} }} | yes
 
         |  <!--Skip blacklist check-->
 
         |  <!--Skip blacklist check-->
 
         | {{cat handler/blacklist| page = {{{page|}}} }}  <!--Check blacklist-->
 
         | {{cat handler/blacklist| page = {{{page|}}} }}  <!--Check blacklist-->
Line 42: Line 38:
 
   | #default  =  
 
   | #default  =  
 
     <!--Check if any namespace parameter is defined-->
 
     <!--Check if any namespace parameter is defined-->
     {{#ifeq: h0#384!5nea+w9 | {{{all| {{{main| {{{talk| {{{user| {{{wikipedia| {{{file| {{{mediawiki| {{{template| {{{help| {{{category| {{{portal| {{{other| h0#384!5nea+w9 }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}}
+
     {{#ifeq: h0#384!5nea+w9 | {{{all| {{{main| {{{talk| {{{user| {{{wikipedia| {{{file| {{{mediawiki| {{{template| {{{help| {{{category| {{{portal| {{{book| {{{other| h0#384!5nea+w9 }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}} }}}
 
     | <!--No namespace parameters fed, basic usage-->
 
     | <!--No namespace parameters fed, basic usage-->
 
       {{namespace detect
 
       {{namespace detect
Line 50: Line 46:
 
       | category = {{{1|}}}
 
       | category = {{{1|}}}
 
       | portal = {{{1|}}}
 
       | portal = {{{1|}}}
 +
      | book = {{{1|}}}
 
       | page = {{{page|}}}  <!--For testing and demonstration-->
 
       | page = {{{page|}}}  <!--For testing and demonstration-->
 
       }}
 
       }}
Line 80: Line 77:
 
         | category = {{{category| {{{other|}}} }}}
 
         | category = {{{category| {{{other|}}} }}}
 
         | portal = {{{portal| {{{other|}}} }}}
 
         | portal = {{{portal| {{{other|}}} }}}
 +
        | book = {{{book| {{{other|}}} }}}
 
         | other = {{{other|}}}  <!--Namespace special or a new namespace-->
 
         | other = {{{other|}}}  <!--Namespace special or a new namespace-->
 
         | page = {{{page|}}}  <!--For testing and demonstration-->
 
         | page = {{{page|}}}  <!--For testing and demonstration-->
Line 87: Line 85:
 
   }}
 
   }}
 
}}<noinclude>
 
}}<noinclude>
 
{{pp-template}}
 
 
{{documentation}}
 
{{documentation}}
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Latest revision as of 18:39, 13 October 2010