Template:Tlxp
外观
| 此Template被引用於約64,000個頁面。 為了避免造成大規模的影響,所有對此Template的編輯應先於沙盒、測試樣例或您的沙盒上測試。 測試後無誤的版本可以一次性地加入此Template中,但是修改前請務必於討論頁發起討論。 模板引用數量會自動更新。 |
| 此模板使用Lua语言: |
使用方法
[编辑]{{tlg}}(template link, general,即“全功能模板連結”)是用來添加模板連結的全功能模板。本模板可以代替或實現任何{{tl*}}類模板的功能,例如{{tl}}、{{tlx}}、{{tlb}}。可用參數如下:
code=yes:使用<code>...</code>HTML屬性(通常是等寬字體),如{{tlc}}、{{tlx}}、{{tlxb}}bold=yes:讓文字變成粗體,如{{tlb}}、{{tlxb}}italic=yes:讓參數變成斜體,如{{tlxi}}nolink=yes:不連結至模板頁面,如{{tlf}}、{{tld}}、{{tlc}}braceinside=yes:將裡面的一層括號包含在連結裡,如{{tn}}subst=yes:添加subst:前綴,如{{tls}}nosubstlink=yes:去除subst:的連結,暫無其他模板可替代(需要添加subst=yes才有效果)
alttext=FOO:將連結本來顯示的文字替換成別的文字,如{{tla}}nowrap=yes:在顯示結果中防止斷行
範例
[编辑]| Code | Output | Remarks |
{{tlg|Abc}} | {{Abc}} | |
{{tlg|abC}} | {{abC}} | template names are case-sensitive |
{{tlg|abc}} | {{abc}} | first letter is case-insensitive though |
{{tlg|x0}} | {{x0}} | |
{{tlg|x0|code=on}} | {{x0}} | <code> style |
{{tlg|x0|plaincode=on}} | {{x0}} | plaincode style |
{{tlg|x0|bold=on}} | {{x0}} | bold link/name |
{{tlg|x1|one|italic=on}} | {{x1|one}} | parameter/s in italics |
{{tlg|x0|nolink=on}} | {{x0}} | |
{{tlg|x0|subst=on}} | {{subst:x0}} | |
{{tlg|x0|braceinside=on}} | {{x0}} | |
{{tlg|x0|alttext=x0 link}} | {{x0 link}} | |
{{tlg|x0|bold=on|code=on|braceinside=on}} | {{x0}} | No reason you can't combine multiple parameter settings |
{{tlg|x1|one}} | {{x1|one}} | |
{{tlg|x2|one|two}} | {{x2|one|two}} | |
{{tlg|x2|bold=on|code=on|one|two}} | {{x2|one|two}} | Can combine named and anonymous parameters … |
{{tlg|x2|one|two|bold=on|code=on}} | {{x2|one|two}} | … in any order … |
{{tlg|x2|one|code=on|two|bold=on|three}} | {{x2|one|two|three}} | … even intermixed … |
{{tlg|x2|one|code=on|two|bold=on|three|italic=on}} | {{x2|one|two|three}} | … with many different configurations. |
{{tlg|x3|1|2|3|4|5|6|7|8|9|10}} | {{x3|1|2|3|4|5|6|7|8|9|10}} | |
{{tlg|x4|1|2|3|4|5|6|7|8|9|10|11}} | {{x4|1|2|3|4|5|6|7|8|9|10|11}} | up to 10 parameters, then … |
{{tlg|x5|1|2|3|4|5|6|7|8|9|10|11}} | {{x5|1|2|3|4|5|6|7|8|9|10|11}} | | for more |
{{tlg}} | {{Template:Tlxp}} | with no arguments, the current page name is substituted |
{{tlg|x1|x=u}} | {{x1}} | = won't work |
{{tlg|x1|x=u}} | {{x1|x=u}} | = is okay |
{{tlg|x1|x{{=}}u}} | {{x1|x=u}} | {{=}} is okay |
{{tlg|x1|x<nowiki>=</nowiki>u}} | {{x1|x=u}} | sticky nowiki is okay |
{{tlg|x2||two||}} | {{x2|two}} | empty parameters work too, even at the end |
{{tlg|x2|3=two|2=one}} | {{x2|one|two}} | right to left okay |
| 連結形式 → | 含有連結 | 不含連結 | 含有連結並添加subst | 含有連結,連結包含括號 | 含有連結,顯示其他文字 | 第一個|替換成:
| |
|---|---|---|---|---|---|---|---|
| 文字樣式 ↓ | {{tlg}}選項1
|
— | nolink=yes
|
subst=yes
|
braceinside=yes
|
alttext=FOO
|
不適用 |
| 正常 | — | {{tl}} · {{tlp}}2 · {{tlg}}1, 2
|
{{tlf}}2 · {{tnull}}
|
{{tls}} · {{tlsp}}
|
{{tn}}
|
{{tla}}
|
{{tlm}}3
|
代碼 code
|
code=yes ortt=yes
|
{{tlx}}
|
{{tlc}}2 · {{tld}}
|
{{tlxs}}
|
{{tlxm}}3
| ||
代碼 syntaxhighlight
|
不適用 | {{tlsh}}
|
{{tlshm}}
| ||||
| 粗體 | bold=yes
|
{{tlb}}
|
|||||
粗體代碼 code
|
bold=yes|code=yes
|
{{tlxb}}
| |||||
斜體代碼 code
|
italic=yes|code=yes
|
{{tlxi}}
| |||||
註釋:1.
{{tlg}}是功能最齊全的模板,可選用任何配搭的文字樣式、連結形式。2. 用<span class="nowrap">...</span>標籤將文字包圍,防止斷行。
- 各顯示樣式的比較
{{tlf|Milford Haven Line|弘安源氏論議}}→ {{Milford Haven Line|弘安源氏論議}}{{tld|Milford Haven Line|弘安源氏論議}}→{{Milford Haven Line|弘安源氏論議}}{{tlc|Milford Haven Line|弘安源氏論議}}→{{Milford Haven Line|弘安源氏論議}}
- 添加參數
{{para|name|{{var|value}}}}→|name=value{{para|name|{{varserif|value}}}}→|name=value{{tlx|Milford Haven Line|參數1{{=}}賦值1}}→{{Milford Haven Line|參數1=賦值1}}