“模板:Namespace detect”的版本间的差异
来自问题求解
小 (保护 Template:Namespace detect: WP:HRT ([edit=sysop] (无期) [move=sysop] (无期))) |
(remove {{pp-template}} since included in {{documentation}}) |
||
第4行: | 第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}} | ||
+ | }} | ||
+ | }} | ||
}} | }} | ||
}} | }} | ||
− | | main | + | <!-- 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|}}} }}} | | talk = {{{talk| {{{other|}}} }}} | ||
| user = {{{user| {{{other|}}} }}} | | user = {{{user| {{{other|}}} }}} | ||
| wikipedia = {{{wikipedia| {{{other|}}} }}} | | wikipedia = {{{wikipedia| {{{other|}}} }}} | ||
− | | image = {{{image| {{{other|}}} }}} | + | | file |
+ | | image = {{{file| {{{image| {{{other|}}} }}} }}} | ||
| mediawiki = {{{mediawiki| {{{other|}}} }}} | | mediawiki = {{{mediawiki| {{{other|}}} }}} | ||
| template = {{{template| {{{other|}}} }}} | | template = {{{template| {{{other|}}} }}} | ||
第23行: | 第32行: | ||
| category = {{{category| {{{other|}}} }}} | | category = {{{category| {{{other|}}} }}} | ||
| portal = {{{portal| {{{other|}}} }}} | | portal = {{{portal| {{{other|}}} }}} | ||
+ | | book = {{{book| {{{other|}}} }}} | ||
| other | | other | ||
− | | #default = {{{other|}}} | + | | #default = {{{other|}}} <!--"demospace=other" or a new namespace--> |
}}<!--End switch--><noinclude> | }}<!--End switch--><noinclude> | ||
− | {{ | + | |
+ | {{documentation}} | ||
+ | <!-- Add categories and interwikis to the /doc subpage, not here! --> | ||
</noinclude> | </noinclude> |
2010年10月5日 (二) 02:40的版本