查看“模块:Unsubst/doc”的源代码
←
模块:Unsubst/doc
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
本页面已经受到保护,不能编辑,因为它被嵌入于以下被“连锁保护”的页面:
模块:Unsubst
您必须确认您的电子邮件地址才能编辑页面。请通过
系统设置
设置并确认您的电子邮件地址。
您可以查看与复制此页面的源代码。
<!-- Categories and interwikis go at the bottom of this page. --> Helper module to facilitate a substituted template transform into a template transclusion. Maintenance templates, such as {{tl|Citation needed}} or {{tl|Refimprove}}, should never be substituted. A trick to avoid that is to make a template substitute to its transcluded form. === Usage === To turn a template into a self-substituting template, wrap the existing template code with: <pre> {{ {{{|safesubst:}}}#invoke:Unsubst||$N=TEMPLATENAME |$B= [ ... existing template code ... ] }} </pre> The name of the template must be given as "$N", and the wikitext to display when not substed must be given as "$B". All other parameters passed to the #invoke will be copied to the generated template invocation as default values. If the value of any of these default parameters is "__DATE__", that value in the generated template invocation will be the current month and year. Some templates have a <nowiki><noinclude></nowiki> but no matching <nowiki></noinclude></nowiki> at the end of the template. In such cases the missing <nowiki></noinclude></nowiki> must be added before the ending <code><nowiki>}}</nowiki></code>. === Example === Consider a template Template:Example containing the following code: <pre> {{ {{{|safesubst:}}}#invoke:Unsubst||$N=Example |foo=bar |date=__DATE__ |$B= [ ... Template code goes here ... ] }} </pre> {| class="wikitable" ! Original !! Result |- | <nowiki>{{subst:example}}</nowiki> || <nowiki>{{Example|foo=bar|date=</nowiki>{{#time:Y年n月}}}} |- | <nowiki>{{subst:example|foo=X}}</nowiki> || <nowiki>{{Example|foo=X|date=</nowiki>{{#time:Y年n月}}}} |- | <nowiki>{{subst:example|baz=X}}</nowiki> || <nowiki>{{Example|foo=bar|baz=X|date=</nowiki>{{#time:Y年n月}}}} |- | <nowiki>{{subst:example|date=January 2001}}</nowiki> || <nowiki>{{Example|foo=bar|date=January 2001}}</nowiki> |} <includeonly> <!-- Categories and interwikis go here: --> [[Category:Wikipedia metatemplates|{{PAGENAME}}]] </includeonly>
该页面使用的模板:
模板:Tl
(
查看源代码
)
模板:Transclude
(
查看源代码
)
返回至
模块:Unsubst/doc
。
导航菜单
个人工具
创建账户
登录
命名空间
模块
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
所有条目
分类索引
PV政策
PV人物
PV电站
PV企业
PV技术
PV标准
PV工艺
PV导航
最近更改
随机页面
帮助
编辑规范
新手速成
编辑手册
能库部署
帮助
链接
光伏們
坎德拉学院
关于
我们的目标
关于能库
工具
链入页面
相关更改
特殊页面
页面信息