查看“模板:Namespace detect”的源代码
←
模板:Namespace detect
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{#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> This template, '''<tt><nowiki>{{namespace detect}}</nowiki></tt>''', is intended for background usage, generally in other templates, so it's not really meant for end-users to worry about. It functions to identify the current namespace and return content tailored to that namespace. ==Usage== The template should be called with parameters for each namespace to be used, e.g.: <pre>{{namespace detect | main= Hello world! | help= How's it going, world? | other= Goodbye, cruel world! }}</pre> The results of this example should be roughly self-explanatory: if called on the main or help namespaces, the first two messages will appear, respectively. If called on ''any other namespace'', the "other" message will appear. To show nothing at all, parameters may be left out entirely.</noinclude>
返回至
模板:Namespace detect
。
导航菜单
个人工具
登录
名字空间
模板
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
官方论坛
帮助
游戏
游戏平台
游戏系列
游戏内容
发行时间
开发商
发行商
特色条目
厂商
开发商
发行商
盗版商
工具
链入页面
相关更改
特殊页面
页面信息