编辑“︁
Template:Tlg/doc
”︁
跳转到导航
跳转到搜索
这是
Tlg
模板的
文档页面
。
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
{{NoteTA|G1=MediaWiki|G2=IT}} {{Documentation subpage}} {{lua|Module:Tlg}} {{#ifexpr:{{#invoke:Transclusion count|fetch|0}} > 2000|{{high-use}}}} {{tlnull|{{#switch:{{lc:{{ROOTPAGENAME}}}} | tlg | template link general = template link general | tlb | template link with bold = template link with bold | tlc | template link code = template link code | tlw | template link with linked braces = template link with linked braces | tlf | template link with link off = template link with link off | tltss | template link with title span, subst = template link with title span, subst | tlx | template link expanded = template link expanded | tlxb | template link expanded with bold = template link expanded with bold | tlxi | template link expanded with italic = template link expanded with italic | tlxs | template link expanded with subst = template link expanded with subst | tls | template link with subst = template link with subst | tnull | template link null = template link null | tlp | template link with parameters = template link with parameters}} }},常缩写为{{tlnull|{{#switch:{{lc:{{ROOTPAGENAME}}}} | tlg | template link general = tlg | tlb | template link with bold = tlb | tlc | template link code = tlc | tlw | template link with linked braces = tlw | tlf | template link with link off = tlf | tltss | template link with title span, subst = tltss | tlx | template link expanded = tlx | tlxb | template link expanded with bold = tlxb | tlxi | template link expanded with italic = tlxi | tlxs | template link expanded with subst = tlxs | tls | template link with subst = tls | tnull | template link null = tnull | tlp | template link with parameters = tlp}} }},其功能是为模板名称的显示提供样式化格式,而无需实际调用该模板。生成的代码将以行内形式呈现。 ==参数== 除{{mono|alttext}}外,所有命名参数均为开关型参数,它们通常可以省略,或通过赋值(如on、yes、true、include等)来激活。这些参数可按任意顺序排列(参见下方示例)。部分模板默认开启特定参数,所有可用的替代选项请查阅主表格。若某行显示效果与上一行完全相同,则表示当前模板不支持该选项,需改用{{tlx|tlg}}实现。 {| class="wikitable" ! 参数 || 功能描述 || 与{{tl|example}}联用示例 || 默认激活的模板 |- | || 默认状态(不使用任何辅助参数) || {{{{{1|tlg}}}|example}} || |- | brace || 将双层大括号作为模板链接的一部分显示 || {{{{{1|tlg}}}|brace=yes|example}} || {{tl|tlw}}/{{tl|tn}} |- | braceinside || 将内层大括号作为模板链接的一部分显示 || {{{{{1|tlg}}}|example|braceinside=yes}} || |- | bold || 将模板链接/名称以'''粗体'''形式显示 || {{{{{1|tlg}}}|bold=yes|example}} || {{tl|tlb}}、{{tl|tlxb}} |- | code || 使用HTML {{tag|code}}标签(以[[等宽字体]])显示输出 || {{{{{1|tlg}}}|code=yes|example}} || {{tl|tlc}}、{{tl|Template link expanded}}等 |- | italic || 将模板链接/名称之后的参数以''斜体''形式显示 ||| {{{{{1|tlg}}}|italic=yes|example|param}} || {{tl|tlxi}} |- | kbd || 使用HTML {{tag|kbd}}标签(等宽字体)显示输出 || {{{{{1|tlg}}}|kbd=yes|example}} || |- | nolink || 不为模板名称添加内部链接 || {{{{{1|tlg}}}|nolink=yes|example}} || {{tl|tlf}}、{{tl|tnull}} |- | nowrap || 在输出内容中禁用[[自动换行]](nowrap) || {{{{{1|tlg}}}|nowrap=yes|example}} || {{tl|tlf}}、{{tl|tlp}} |- | nowrapname || 在模板名称/链接的输出中禁用自动换行(参数部分在必要时仍会换行) || {{{{{1|tlg}}}|nowrapname=yes|example}} || |- | plaincode || 使用样式为“border:none; background:transparent;”的{{tag|code|wrap=yes}}标签 || {{{{{1|tlg}}}|plaincode=yes|example}} || {{tl|tltss}} |- | subst || 在模板链接/名称前添加[[Help:替换引用|subst:]]前缀 || {{{{{1|tlg}}}|subst=yes|example}} || {{tl|tls}}、{{tl|tlxs}}等 |- | alttext=<code style="padding:0; margin:0">[text]</code> || 将模板链接的显示文本替换为自定义文本<code style="padding:0; margin:0">[text]</code> || {{{{{1|tlg}}}|alttext=Other|example}} || {{tl|tla}} |- | _show_result || 同时显示调用该模板后的实际渲染结果 || {{{{{1|tlg}}}|Min|7|-5|_show_result=y}} || |- | _expand || 添加指向该模板展开后页面的链接 || {{{{{1|tlg}}}|Min|7|-5|_expand=y}} || |- | a || 在模板代码前添加一个星号(*) || {{{{{1|tlg}}}|Min|7|-5|a=y}} || |} ====匿名参数==== 本模板可以接受不限数量的匿名参数,这些参数将作为模板链接(或名称)的附加参数一同显示;具体用法请参见下方示例。 == 範例 == {{#ifeq:{{SITENAME}}|Wikipedia|<!-- Skip message--->| {{#ifeq:{{SITENAME}}|Meta|<!-- No note needed --->|<!-- Other Sisters Note: ---> ;Note: On the source sister projects, en.wikipedia and Meta, '''X0, X1, X2, …, X9 are sandbox templates''' for experimentation on involved templates that need be in template space. An auto-cleansing software facility exists that might be used to duplicate the facility on other Sister projects. }}}} {{Aligned table |cols=3 |class=wikitable |row1header=y |style=background-color:transparent;color:inherit | 代码 | 输出 | 备注 | {{tlx|tlg|Example}} | {{tlg|Example}} | | {{tlx|tlg|ExAmple}} | {{tlg|ExAmple}} | 模板名称区分大小写 | {{tlx|tlg|example}} | {{tlg|example}} | 首字母不区分大小写 | {{tlx|tlg|x0}} | {{tlg|x0}} | | {{tlx|tlg|x0|code{{=}}on}} | {{tlg|x0|code=on}} | <code>样式 | {{tlx|tlg|x0|plaincode{{=}}on}} | {{tlg|x0|plaincode=on}} | plaincode样式 | {{tlx|tlg|x0|bold{{=}}on}} | {{tlg|x0|bold=on}} | 链接/名称加粗 | {{tlx|tlg|x1|one|italic{{=}}on}} | {{tlg|x1|one|italic=on}} | 参数以斜体显示 | {{tlx|tlg|x0|nolink{{=}}on}} | {{tlg|x0|nolink=on}} | | {{tlx|tlg|x0|subst{{=}}on}} | {{tlg|x0|subst=on}} | | {{tlx|tlg|x0|braceinside{{=}}on}} | {{tlg|x0|braceinside=on}} | | {{tlx|tlg|x0|alttext{{=}}x0 link}} | {{tlg|x0|alttext=x0 link}} | | {{tlx|tlg|x0|bold{{=}}on|code{{=}}on|braceinside{{=}}on}} | {{tlg|x0|bold=on|code=on|braceinside=on}} | 可以组合使用多个参数设置 | {{tlx|tlg|x1|one}} | {{tlg|x1|one}} | | {{tlx|tlg|x2|one|two}} | {{tlg|x2|one|two}} | | {{tlx|tlg|x2|bold{{=}}on|code{{=}}on|one|two}} | {{tlg|x2|bold=on|code=on|one|two}} | 可以组合使用命名参数和匿名参数…… | {{tlx|tlg|x2|one|two|bold{{=}}on|code{{=}}on}} | {{tlg|x2|one|two|bold=on|code=on}} | ……以任意顺序…… | {{tlx|tlg|x2|one|code{{=}}on|two|bold{{=}}on|three}} | {{tlg|x2|one|code=on|two|bold=on|three}} | ……甚至可以交错排列…… | {{tlx|tlg|x2|one|code{{=}}on|two|bold{{=}}on|three|italic{{=}}on}} | {{tlg|x2|one|code=on|two|bold=on|three|italic=on}} | ……并形成多种不同的配置。 | {{tlx|tlg|x3|1|2|3|4|5|6|7|8|9|10}} | {{tlg|x3|1|2|3|4|5|6|7|8|9|10}} | | {{tlx|tlg}} | {{tlg}} | 若无参数,则自动代入当前页面名称 | {{tlx|tlg|x1|x=u}} | {{tlg|x1|x=u}} | '''{{=}}'''符号无法直接使用 | {{tlx|tlg|x1|x&#61;u}} | {{tlg|x1|x=u}} | {{align|right|<code>&#61;</code>可以正常使用}} | {{tlx|tlg|x1|x<nowiki>{{=}}</nowiki>u}} | {{tlg|x1|x{{=}}u}} | {{align|right|<code><nowiki>{{=}}</nowiki></code>可以正常使用}} | {{tlx|tlg|x1|x<nowiki>=</nowiki>u}} | {{tlg|x1|x<nowiki>=</nowiki>u}} | {{align|right|nowiki标签可以正常使用}} | {{tlx|tlg|x2|<nowiki />|two|<nowiki />|<nowiki />}} | {{tlg|x2||two||}} | 空参数同样有效,即使位于末尾 | {{tlx|tlg|x2|<nowiki>3=two</nowiki>|<nowiki>2=one</nowiki>}} | {{tlg|x2|3=two|2=one}} | {{align|right|从右到左也可以正常处理}} }} {| class="wikitable" |style="background-color:transparent;color:inherit;" |+ style="text-align:left;" | 长名称的换行处理(默认情况) |- ! 代码 ! style="width:15em;" | 输出 |- | {{tlx|{{{1|tlg}}}|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|long template name that would wrap to new line|this is a long value for the 1st parameter that would wrap}} |} {| class="wikitable" |style="background-color:transparent;color:inherit;" |+ style="text-align:left;" | 长名称的换行处理(<kbd>nowrap=on</kbd>) |- ! 代码 ! style="width:15em;" | 输出 |- | {{tlx|{{{1|tlg}}}|nowrap: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|nowrap=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |} {| class="wikitable" |style="background-color:transparent;color:inherit;" |+ style="text-align:left;" | 长名称的换行处理(<kbd>nowrapname=on</kbd>) |- ! 代码 ! style="width:15em;" | 输出 |- | {{tlx|{{{1|tlg}}}|nowrapname: on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} | {{{{{1|tlg}}}|nowrapname=on|long template name that would wrap to new line|long value for the 1st parameter that would wrap}} |} ==参见== {{tl-nav}} <includeonly>{{Sandbox other|| <!-- 本行下加入模板的分類 --> [[Category:輸入支援模板]] [[Category:内联模板]] }}</includeonly>
摘要:
请注意,所有对Local Chinese Wikipedia的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Project:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
导航菜单
个人工具
未登录
讨论
贡献
创建账号
登录
命名空间
模板
讨论
大陆简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
查看
阅读
编辑
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息