Template:Namespace detect: Difference between revisions

m
remove {{pp-template}}
(remove {{pp-template}} since included in {{documentation}})
m (remove {{pp-template}})
Line 4: Line 4:
     {{#if:{{{demospace|}}}  
     {{#if:{{{demospace|}}}  
     | {{{demospace}}}
     | {{{demospace}}}
     | {{#if:{{{page|}}}  
     | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
       | <!--Detect the namespace in the "page" parameter-->
       | main
        {{#ifeq:{{NAMESPACE:{{{page}}} }}|{{TALKSPACE:{{{page}}} }}
      | {{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
         | talk
         | talk
         | {{SUBJECTSPACE:{{{page}}} }}  
         | {{NAMESPACE}}  
         }}
         }}
      | <!--No "demospace" or "page" parameters, so detect actual namespace-->
       }}  
        {{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
        | talk
        | {{SUBJECTSPACE}}
        }}
       }}
     }}
     }}
   }}
   }}
<!-- Only one of the lines below will be executed -->
<!-- Only one of the lines below will be executed -->
<!-- Respecting empty parameters on purpose -->
<!-- Respecting empty parameters on purpose -->
| main       <!--"demospace=main" or {{SUBJECTSPACE}}={{ns:0}}=""-->
| main     = {{{main| {{{other|}}} }}}
|          = {{{main| {{{other|}}} }}}
| talk      = {{{talk| {{{other|}}} }}}
| talk      = {{{talk| {{{other|}}} }}}
| user      = {{{user| {{{other|}}} }}}
| user      = {{{user| {{{other|}}} }}}
Line 32: Line 26:
| category  = {{{category| {{{other|}}} }}}
| category  = {{{category| {{{other|}}} }}}
| portal    = {{{portal| {{{other|}}} }}}
| portal    = {{{portal| {{{other|}}} }}}
| book      = {{{book| {{{other|}}} }}}
| other
| other
| #default  = {{{other|}}}  <!--"demospace=other" or a new namespace-->
| #default  = {{{other|}}}  <!--"demospace=other" or a new namespace-->
90,866

edits