Difference between revisions of "Template:Namespace detect"

From Kumu Wiki - TRU
Jump to navigation Jump to search
(switch to Lua implementation)
m (1 revision)
Line 1: Line 1:
{{#invoke:Namespace detect|main}}<noinclude>
+
{{#switch:
 +
  {{lc:              <!--Lower case the result-->
 +
    <!--If no or empty "demospace" parameter then detect namespace-->
 +
    {{#if:{{{demospace|}}}
 +
    | {{{demospace}}}
 +
    | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
 +
      | main
 +
      | {{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
 +
        | talk
 +
        | {{NAMESPACE}}
 +
        }}
 +
      }}
 +
    }}
 +
  }}
 +
<!-- Only one of the lines below will be executed -->
 +
<!-- Respecting empty parameters on purpose -->
 +
| main      = {{{main| {{{other|}}} }}}
 +
| talk      = {{{talk| {{{other|}}} }}}
 +
| user      = {{{user| {{{other|}}} }}}
 +
| wikipedia = {{{wikipedia| {{{other|}}} }}}
 +
| file
 +
| image    = {{{file| {{{image| {{{other|}}} }}} }}}
 +
| mediawiki = {{{mediawiki| {{{other|}}} }}}
 +
| template  = {{{template| {{{other|}}} }}}
 +
| help      = {{{help| {{{other|}}} }}}
 +
| category  = {{{category| {{{other|}}} }}}
 +
| portal    = {{{portal| {{{other|}}} }}}
 +
| other
 +
| #default  = {{{other|}}}   <!--"demospace=other" or a new namespace-->
  
 +
}}<!--End switch--><noinclude>
 +
 +
{{pp-template|small=yes}}
 
{{documentation}}
 
{{documentation}}
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
+
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 
</noinclude>
 
</noinclude>

Revision as of 15:13, 23 October 2013

[create] Template-info.svg Template documentation