Template:URL2
此模 |
概要
[编辑]Template:URL
参 数 省略 或 为空时不显示任 何 内容 。Template:URL则默认显示 {{URL|example.com|
。可 选的显示文 本 }}提供 一 个|msg=
参 数 ,可 开启或 关闭{{URL|example.com|
可 选的显示文 本 }}的 显示。msg参 数 为false或 者 任 何 以字母 n或 N开头,都会 关闭消息 ,其他内容 则使消息 为打开状态。提供 的 url参 数 中 的 html标签和 wiki内部 链接标签会 被 去 除 。- url
参 数 在 首 个空格 处截止 。 可 以将自身 的 输出作 为输入 ,从而可 以在信 息 框 的 网站参 数 中 嵌 套使用 ,避免编者在 条目 中 二 次 添加 如|website={{URL|some.url.com}}
的 代 码会导致的 解析 错误。
用法
[编辑]{{URL2|url}}
{{URL2|1=url}}
範 例
[编辑]与 Template:URL的 差 异
[编辑]无输|msg=
{{URL2| }}
→
{{URL2|msg=yes| }}
→{{URL|example.com|
可 选的显示文 本 }}
{{URL2|msg=true| }}
→{{URL|example.com|
可 选的显示文 本 }}
{{URL2|msg=1| }}
→{{URL|example.com|
可 选的显示文 本 }}
URL2|website=
{{URL2|[http://www.example.com]}}
→ www.example .com
{{URL2|http://www.example.com|website}}
→ website
{{URL2|{{URL|www.example.com}}}}
→ www.example .com
{{URL2|{{URL2|www.example.com}}}}
→ www.example .com
相 同 之 处
[编辑]<span class="url">...</span>
并在
{{URL2|www.example.com}}
→ www.example .com [http://www.example.com www
.example .com]
The use of http://, https://, a protocol-relative URL, or a different protocol is preserved in the URL but is not shown in the link text:
{{URL2|http://www.example.com}}
→ www.example .com [http://www.example.com www
.example .com]
{{URL2|https://www.example.com}}
→ www.example .com [https://www.example.com www
.example .com]
{{URL2|//www.example.com}}
→ www.example .com [//www.example.com www
.example .com]
{{URL2|ftp://ftp.example.com}}
→ ftp.example .com [ftp://ftp.example.com ftp
.example .com]
If the path is only a slash (/
) it is not displayed in the link text:
{{URL2|https://www.example.com/}}
→ www.example .com [https://www.example.com/ www
.example .com]
The template also adds <wbr/> before any displayed slashes (/
) in the path:
{{URL2|https://www.example.com/path}}
→ www.example .com /path [https://www.example.com/path www
.example .com /path]
For a URL containing an equal sign (=
), use |1=
:
{{URL2|1=http://www.example.com/path?section=17}}
→ www.example .com /path?section=17 [http://www.example.com/path?section=17 www
.example .com /path?section=17]
注意 事 项
[编辑]重定 向
[编辑]模 板 编辑说明
[编辑]微 格式
[编辑]此模class="url"
參 見
[编辑]- {{URL}}
- {{Official URL}}
- {{Official website}}
编者 请在/doc |