Шаблон:Namespace detect — различия между версиями

Материал из ANT-Inform documentation
Перейти к: навигация, поиск
(Copy http://www.mediawiki.org/w/index.php?title=Template:Namespace_detect&action=edit)
 
м (1 версия: Import templates from MediaWiki)
 
(не показана одна промежуточная версия этого же участника)
Строка 1: Строка 1:
{{#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 = {{{project| {{{other|}}} }}}| file| image    = {{{file| {{{image| {{{other|}}} }}} }}}| mediawiki = {{{mediawiki| {{{other|}}} }}}| template  = {{{template| {{{other|}}} }}}| help      = {{{help| {{{other|}}} }}}| category  = {{{category| {{{other|}}} }}}| book      = {{{book| {{{other|}}} }}}| other| #default  = {{{other|}}}  <!--"demospace=other" or a new namespace-->}}<!--End switch--><noinclude>{{documentation}}<!-- Add categories and interwikis to the /doc subpage, not here! --></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 = {{{project| {{{other|}}} }}}
 +
| file
 +
| image    = {{{file| {{{image| {{{other|}}} }}} }}}
 +
| mediawiki = {{{mediawiki| {{{other|}}} }}}
 +
| template  = {{{template| {{{other|}}} }}}
 +
| help      = {{{help| {{{other|}}} }}}
 +
| category  = {{{category| {{{other|}}} }}}
 +
| book      = {{{book| {{{other|}}} }}}
 +
| other
 +
| #default  = {{{other|}}}  <!--"demospace=other" or a new namespace-->
 +
 
 +
}}<!--End switch--><noinclude>
 +
 
 +
{{documentation}}
 +
<!-- Add categories and interwikis to the /doc subpage, not here! -->
 +
</noinclude>

Текущая версия на 12:40, 8 февраля 2013


[create] 50px Template documentation