한국   대만   중국   일본 
Template:URL - ?基百科,自由的百科全? 跳?到?容

Template : URL

被永久保护的模板
?基百科,自由的百科全?
文档图示 模板文? [ ?看 ] [ ?? ] [ ?史 ] [ ?除?存 ]

本模版用于生成格式化的外部?接。本模板生成的?接?使用 <wbr> ?行?理,方便??器自??行。

用法

{{URL|1= url name |2= optional display text }}

  • 第一???用于?入相?的URL外?,??其分析,如果?附?相?的??名的?,默?添加?「http://」???,如果有相????的?,?根据????示相?的?接??,?支持「 http:// 」,「 https:// 」和「 ftp:// 」三???。
  • 第二????可???,可以改??接?示?的名?,若留空,?直接?示?接。
:如果?指定第一???的?,第二???直接?示?入?,但不生成?接。
  • 如果不?任何??,?自?生成模板的例子?法。

含有等?的?址

如果?址中含有等?(“=”),需指定?? |1=

  • {{URL | 1=https://example.com/?id=42 }} example .com?id=42
    <span class="url">[https://example.com/?id=42 example<wbr/>.com?id=42]</span>
    

此?,如果指定??,第二???也需?式?示:

  • {{URL | 1=https://example.com/?id=42 | 2=Title }} Title
    <span class="url">[https://example.com/?id=42 Title]</span>
    
警告:
  • 强烈建??式?明??名??入??(尤其?接中有?似 等? ("=")?),避免??解?,?致无法?示?接。如果存在第二??的?,更加需要?式??名,以免??覆盖第一??的?。
  • 如果?接中含有包含??或井?的??字符串的?,强烈建??接后加「/」做?束,以免解???,「/」不?被?示出?的,?放心。?防止?????字符串被改?(如小?化),强烈建?使用?式??名?入??。

範例

Code Result
{{ URL }} {{ URL | example.com | 可?的?示文本 }}
{{ URL | }} {{ URL | example.com | 可?的?示文本 }}
{{URL ||example}} example
{{ URL | EXAMPLE.com }} example .com
{{ URL | example.com }} example .com
{{ URL | www.example.com }} www .example .com
{{ URL | http://www.example.com }} www .example .com
{{ URL | https://www.example.com }} www .example .com
{{ URL | ftp://www.example.com }} www .example .com
{{ URL | ftp://ftp.example.com }} ftp .example .com
{{ URL | http://www.example.com/ }} www .example .com
{{ URL | http://www.example.com/path }} www .example .com /path
{{ URL | www.example.com/foo }} www .example .com /foo
{{ URL | http://www.example.com/foo | link }} link
{{ URL | www.example.com/foo | link }} link
{{ URL | http://www.example.com/path/ }} www .example .com /path /
{{ URL | www.example.com/foo/ }} www .example .com /foo /
{{ URL | http://www.example.com/foo/ | link }} link
{{ URL | www.example.com/foo/ | link }} link

微格式

The template wraps the displayed URL with a class="url" so that it is included in any parent microformat which takes a URL parameter - see our microformats project .

參見