Template:Namespace detect: Difference between revisions

m
Protected "Template:Namespace detect": High traffic page ([Delete=Allow only administrators and content moderators] (indefinite) [Edit=Allow only administrators and content moderators] (indefinite) [Move=Allow only administrators and content moderators] (indefinite))
m (2 revisions imported: Import from https://sims.wikia.com)
m (Protected "Template:Namespace detect": High traffic page ([Delete=Allow only administrators and content moderators] (indefinite) [Edit=Allow only administrators and content moderators] (indefinite) [Move=Allow only administrators and content moderators] (indefinite)))
 
(3 intermediate revisions by the same user not shown)
Line 1:
{{SAFESUBST:<noinclude />#invoke:Namespace detect|main}}<noinclude>
{{#switch:
{{lc: <!--Lower case the result-->
<!--If no or empty "demospace" parameter then detect namespace-->
{{#if:{{{demospace|}}}
| {{{demospace}}}
| {{#if:{{{page|}}}
| <!--Detect the namespace in the "page" parameter-->
{{#ifeq:{{NAMESPACE:{{{page}}} }}|{{TALKSPACE:{{{page}}} }}
| talk
| {{SUBJECTSPACE:{{{page}}} }}
}}
| <!--No "demospace" or "page" parameters, so detect actual namespace-->
{{#ifeq:{{NAMESPACE}}|{{TALKSPACE}}
| talk
| {{SUBJECTSPACE}}
}}
}}
}}
}}
<!-- Only one of the lines below will be executed -->
<!-- Respecting empty parameters on purpose -->
| main <!--"demospace=main" or {{SUBJECTSPACE}}={{ns:0}}=""-->
| = {{{main| {{{other|}}} }}}
| talk = {{{talk| {{{other|}}} }}}
| user = {{{user| {{{other|}}} }}}
| project
| the sims wiki = {{{the sims wiki| {{{project| {{{other|}}} }}} }}}
| file
| image = {{{file| {{{image| {{{other|}}} }}} }}}
| mediawiki = {{{mediawiki| {{{other|}}} }}}
| template = {{{template| {{{other|}}} }}}
| help = {{{help| {{{other|}}} }}}
| category = {{{category| {{{other|}}} }}}
| module = {{{module| {{{other|}}} }}}
| gadget = {{{gadget| {{{other|}}} }}}
| gadget definition = {{{gadget definition| {{{other|}}} }}}
| other
| #default = {{{other|}}} <!--"demospace=other" or a new namespace-->
 
}}<!--End switch--><noinclude>
 
{{documentation}}