“模板:Namespace detect”的版本间的差异
来自问题求解
小 (保护 Template:Namespace detect: WP:HRT ([edit=sysop] (无期) [move=sysop] (无期))) |
小 (1个修订) |
||
(未显示2个用户的2个中间版本) | |||
第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> |
2012年7月23日 (一) 16:13的最新版本