The editors' meeting has been canceled for technical reasons.

Template:Template link/doc: Difference between revisions

From NeuroWiki
Jump to navigation Jump to search
m 1 revision imported
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
{{lua|Array}}
{{lua|Array}}
{{shortcut|tl|t}}
{{shortcut|tl|t}}
本模板可以用来创建一条访问至对应[[help:模板|模板]]的带有大括号的链接(Template Link),以便于使用者复制或查看相关[[help:模板|模板]]介绍。
This template can be used to create a link (Template Link) with curly braces pointing to the corresponding [[help:Template|template]], allowing users to copy or view related [[help:Template|template]] documentation.


本模板亦有别名{{tl|T}}{{tl|模板}}{{tl|模板链接}}
This template also has aliases: {{tl|T}}, {{tl|Template}}, {{tl|Template link}}.


== 用法 ==
== Usage ==
<code><nowiki>{{tl|模板名}}</nowiki></code><code><nowiki>{{tl|模板名|参数}}</nowiki></code>
<code><nowiki>{{tl|template name}}</nowiki></code> or <code><nowiki>{{tl|template name|parameter}}</nowiki></code>.


== 应用例 ==
== Examples ==
=== 目标模板无需参数 ===
=== Target template without parameters ===
:代码:<code><nowiki>{{tl|hide}}</nowiki></code>
:Code: <code><nowiki>{{tl|hide}}</nowiki></code>
:效果:{{tl|hide}}
:Result: {{tl|hide}}


=== 目标模板仅{{color|blue|1}}个参数 ===
=== Target template with only {{color|blue|1}} parameter ===
:代码:<code><nowiki>{{tl|hide|标题}}</nowiki></code>
:Code: <code><nowiki>{{tl|hide|title}}</nowiki></code>
:效果:{{tl|hide|标题}}
:Result: {{tl|hide|title}}


=== 目标模板有{{color|green|}}个参数或需要指定名字的参数 ===
=== Target template with {{color|green|multiple}} parameters or named parameters ===
:代码:<code><nowiki>{{tl|hide|标题=title|内容=text}}</nowiki></code>
:Code: <code><nowiki>{{tl|hide|title=title|content=text}}</nowiki></code>
:效果:{{tl|hide|<nowiki>标题=title|内容=text</nowiki>}}
:Result: {{tl|hide|<nowiki>title=title|content=text</nowiki>}}


== 注意事项 ==
== Notes ==
*该模板只能链入{{color|blue|Template:}}(“模板:”)页面空间中的内容,因此使用此模板生成的链接中会自动补全<code>Template:</code>前缀。
*This template can only link to content within the {{color|blue|Template:}} namespace. Therefore, the links generated using this template will automatically prepend the <code>Template:</code> prefix.


== 另见 ==
== See Also ==
* {{tl|Para}}
* {{tl|Para}}
* {{tl|Param}}
* {{tl|Param}}
Line 31: Line 31:


<includeonly>
<includeonly>
<!-- 模板分类/跨语言链接 -->
<!-- Template categorization/interlanguage links -->
[[Category:链接模板]]
[[Category:Link templates]]


[[en:Template:Template link]]
[[zh:Template:Template link]]
</includeonly><noinclude>
</includeonly><noinclude>
<!-- 文档分类/跨语言链接 -->
<!-- Documentation categorization/interlanguage links -->
[[en:Template:Template link/doc]]
[[zh:Template:Template link/doc]]
[[Category:模板文档]]
[[Category:Template Documentation]]
</noinclude>
</noinclude>

Latest revision as of 19:51, 13 January 2025

Template:Documentation header

This template uses Module:Array, this script is written in Lua.
For more details, please refer to Wikipedia:Lua and Extension:Scribunto.

This template can be used to create a link (Template Link) with curly braces pointing to the corresponding template, allowing users to copy or view related template documentation.

This template also has aliases: {{T}}, {{Template}}, {{Template link}}.

Usage

{{tl|template name}} or {{tl|template name|parameter}}.

Examples

Target template without parameters

Code: {{tl|hide}}
Result: {{hide}}

Target template with only 1 parameter

Code: {{tl|hide|title}}
Result: {{hide|title}}

Target template with multiple parameters or named parameters

Code: {{tl|hide|title=title|content=text}}
Result: {{hide|title=title|content=text}}

Notes

  • This template can only link to content within the Template: namespace. Therefore, the links generated using this template will automatically prepend the Template: prefix.

See Also