查看“模板:Template sandbox notice/doc”的源代码
←
模板:Template sandbox notice/doc
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
该页面已被保护以防止编辑和其他操作。
本页面已经受到保护,不能编辑,因为它被嵌入于以下被“连锁保护”的页面:
模板:Template sandbox notice
您必须确认您的电子邮件地址才能编辑页面。请通过
系统设置
设置并确认您的电子邮件地址。
您可以查看与复制此页面的源代码。
{{Documentation subpage}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. --> {{Sandbox not}} {{缺乏中文说明}} This is the {{tl|template sandbox notice}} template. It can be placed on template /sandbox pages. It also detects when it is not on a /sandbox page and then shows nothing, thus it can be left in the code when copied and pasted to the main template. (Although most users remove the sandbox notice when they copy the code from the /sandbox to the main template. But beware, if the '''notice-not-sandbox''' parameter has been used then the sandbox notice must be copied with the rest of the template code. See more below.) To learn more about how to use template /sandbox and /testcases subpages see [[Wikipedia:Template test cases]]. === Simple example === <pre> <!-- template code --><noinclude> {{template sandbox notice}} </noinclude> </pre> '''Note!''' The template code must start directly before and physically touch the <code><noinclude></code> tag. Any blank space or newlines between the template code and the <code><noinclude></code> tag can cause the template to render unwanted spaces or newlines when used. === Non-standard "/sandbox" and "/testcases" names === This template uses case-insensitive matching, so will match "/Sandbox", "/SandBox", "/sAnDbOx" etc. without any special help. If the /sandbox page has another name, for instance "/sandbag", then you need to tell the sandbox notice the name of the page, so that it knows when to show and when not to show itself. Like this: <pre> <!-- Template code --><noinclude> {{template sandbox notice | subpage-name=sandbag }} </noinclude> </pre> If the testcases page has another name, this may be specified using the testcases-name parameter: <pre> <!-- Template code --><noinclude> {{template sandbox notice | testcases-name=testbox}} </noinclude> </pre> Provided there is only one sandbox or testcases page in use for the particular main page, another option is to move the sandbox page to the standard "/sandbox" name, or testcases to "/testcases". That may be preferable since other templates and tools also assume that the sandbox uses that name, such as {{tl|documentation}}. === Showing and hiding other things === The sandbox notice can also help showing and hiding other things depending on if it detects it is on the /sandbox page or not. Like this: <pre> <!-- Template code --><noinclude> {{template sandbox notice | notice-for-sandbox = Text that shows on the /sandbox page. | notice-not-sandbox = Text that will show on other pages. }} <!-- Text for all pages goes here --> </noinclude> </pre> === Protection template example === The '''notice-not-sandbox''' parameter can for instance be used so a protection template can be placed already in the /sandbox version of the code. (See also [[Wikipedia:Protection policy]].) Like this: <pre> <!-- Template code --><noinclude> {{template sandbox notice | notice-not-sandbox = {{pp-semi-template|small=yes}} }} </noinclude> </pre> === Documentation example === Some templates have their documentation on a separate /doc page, and then show that documentation in a green doc box below the template code by using the {{tl|documentation}} template. (See also [[Wikipedia:Template documentation]].) Then place the sandbox notice like this: <pre> <!-- Template code --><noinclude> {{template sandbox notice}} {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></pre> === Super deluxe example === This example handles both a protection template and a green doc box from a /doc page at the same time. (See also [[Wikipedia:Protection policy]] and [[Wikipedia:Template documentation]].) Like this: <pre> <!-- Template code --><noinclude> {{template sandbox notice | notice-for-sandbox = Text that shows on the /sandbox page. | notice-not-sandbox = {{pp-semi-template|small=yes}} }} {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> </pre> === Copy, paste & delete === The following "complete" example can be used to copy and paste into your template, then delete the parts you don't need: <pre> <!-- Template code --><noinclude> {{template sandbox notice | notice-for-sandbox = | notice-not-sandbox = <!-- Protection templates as big message boxes --> {{pp-dispute}} {{pp-office}} {{pp-move}} {{pp-protected}} {{pp-template}} {{pp-usertalk}} {{pp-vandalism}} {{pp-semi-protected}} {{pp-semi-sock}} {{pp-semi-spambot}} {{pp-semi-template}} {{pp-semi-usertalk}} {{pp-semi-vandalism}} <!-- Protection templates as small icons --> {{pp-dispute|small=yes}} {{pp-office|small=yes}} {{pp-move|small=yes}} {{pp-protected|small=yes}} {{pp-template|small=yes}} {{pp-usertalk|small=yes}} {{pp-vandalism|small=yes}} {{pp-semi-protected|small=yes}} {{pp-semi-sock|small=yes}} {{pp-semi-spambot|small=yes}} {{pp-semi-template|small=yes}} {{pp-semi-usertalk|small=yes}} {{pp-semi-vandalism|small=yes}} <!-- End protection templates, stop deleting, keep next line --> }} <!-- Text for all pages goes here --> {{documentation}} <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude> </pre> === Technical details === If there is an accompanying "/testcases" page this template will detect that and show a link to the /testcases page. This template categorises /sandbox pages into [[:Category:Template sandboxes]]. If you don't want a page to be categorised then use the template like this: :<code><nowiki>{{template sandbox notice|category=}}</nowiki></code> If you want to demonstrate the template on say [[Wikipedia:Template messages/Template namespace]] then you need to feed the '''subpage-name''' to make it show and feed an empty '''category''' parameter so it doesn't categorise the page. Like this: :<code><nowiki>{{template sandbox notice|subpage-name=Template namespace|category=}}</nowiki></code> === See also === * {{tl|Template test cases notice}} – To put on top of /testcases pages. * [[Wikipedia:Template messages/Template namespace]] – Lists and shows most template related message boxes. <includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS --> [[Category:沙盒模板]] [[Category:模板页的模板|{{PAGENAME}}]] </includeonly>
该页面使用的模板:
模板:Documentation subpage
(
查看源代码
)
模板:Sandbox not
(
查看源代码
)
模板:Tl
(
查看源代码
)
模板:Transclude
(
查看源代码
)
模板:缺乏中文说明
(
查看源代码
)
返回至
模板:Template sandbox notice/doc
。
导航菜单
个人工具
创建账户
登录
命名空间
模板
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
所有条目
分类索引
PV政策
PV人物
PV电站
PV企业
PV技术
PV标准
PV工艺
PV导航
最近更改
随机页面
帮助
编辑规范
新手速成
编辑手册
能库部署
帮助
链接
光伏們
坎德拉学院
关于
我们的目标
关于能库
工具
链入页面
相关更改
特殊页面
页面信息