Template:Namespace detect: Difference between revisions
m (remove {{pp-template}}) |
(update code) |
||
Line 4: | Line 4: | ||
{{#if:{{{demospace|}}} | {{#if:{{{demospace|}}} | ||
| {{{demospace}}} | | {{{demospace}}} | ||
| {{# | | {{#if:{{{page|}}} | ||
| | | <!--Detect the namespace in the "page" parameter--> | ||
{{#ifeq:{{NAMESPACE:{{{page}}} }}|{{TALKSPACE:{{{page}}} }} | |||
| talk | | 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 --> | <!-- Only one of the lines below will be executed --> | ||
<!-- Respecting empty parameters on purpose --> | <!-- Respecting empty parameters on purpose --> | ||
| main | | main <!--"demospace=main" or {{SUBJECTSPACE}}={{ns:0}}=""--> | ||
| = {{{main| {{{other|}}} }}} | |||
| talk = {{{talk| {{{other|}}} }}} | | talk = {{{talk| {{{other|}}} }}} | ||
| user = {{{user| {{{other|}}} }}} | | user = {{{user| {{{other|}}} }}} | ||
Line 26: | Line 32: | ||
| 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--> |
Revision as of 06:02, 1 March 2012
The above documentation is transcluded from Template:Namespace detect/doc. (editEditors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |