Template:Namespace detect: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Davidgothberg
Changed to also understand "file=File page text" and "demospace=file". To handle the announced change from "Image" to "File" naming of that namespace.
Ookami (talk | contribs)
m 11 revisions imported
 
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{#switch:
{{SAFESUBST:<noinclude />#invoke:Namespace detect|main}}<noinclude>
  {{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}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
</noinclude>
</noinclude>

Latest revision as of 22:48, 3 September 2020