324
edits
Note: This is a project under development. The articles on this wiki are just being initiated and broadly incomplete. You can Help creating new pages.
Changes
Created page with "{{Documentation subpage}} {{lua|Module:URL}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> This template can be used to create a formatted external..."
{{Documentation subpage}}
{{lua|Module:URL}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
This template can be used to create a formatted external link.
: ''Note - this template is for formatting the appearance of '''''displayed''''' URLs, while making them ''machine-readable'' as part of emitted [[microformat]] meta-data.
If you wish to display text instead of the URL (e.g. "[http://bbc.co.uk BBC website]" instead of {{URL|bbc.co.uk}}), please '''do not use this template'''.
For web-based references, please see [[Wikipedia:Citation templates]]''
== Usage ==
* <code><nowiki>{{URL|</nowiki>1=''url name''<nowiki>|</nowiki>2=''optional display text''<nowiki>}}</nowiki></code>
** The first parameter is parsed to see if it takes the form of a complete URL. If it doesn't start with a URI scheme (such as "http:", "https:", or "ftp:"), an "http://" prefix will be prepended to the specified generated target URL of the link.
** Parameter 2 is '''deprecated''' and should not be used.
'''Warning:''' The parameter 1 must be numbered explicitly if the URL contains an equal sign, as is common in the query string. This applies when the value of the URL is unknown, for example when this template is used in another template specifying the effective URL as a variable value. The ''deprecated'' second parameter for the displayed text, if present in legacy uses, '''must''' also be explicitly numbered if the first parameter is explicitly numbered; otherwise it will override the value of the first parameter.
'''Note:''' Instead of hard-coding the URL with this template, the URL can be fetched from the [[d:Property:P856|"Official website" property (P856)]] on [[Wikidata]] by using {{tlx|Official URL}}. Consider using that template, for infoboxes in particular.
=== Examples ===
{| class="wikitable"
|-
! Code !! Result
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki> }}</nowiki></code>
| {{ {{BASEPAGENAME}} }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| }}</nowiki></code>
| {{ {{BASEPAGENAME}} | }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| EXAMPLE.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | EXAMPLE.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| https://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | https://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| ftp://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | ftp://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| ftp://ftp.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | ftp://ftp.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/path }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/path }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| irc://irc.example.com/channel }}</nowiki></code>
| {{ {{BASEPAGENAME}} | irc://irc.example.com/channel }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/path/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/path/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| 1=http://www.example.com/path?section=17 }}</nowiki></code>
| {{ {{BASEPAGENAME}} | 1=http://www.example.com/path?section=17 }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| 1=www.example.com/foo?page=42 }}</nowiki></code>
| {{ {{BASEPAGENAME}} | 1=www.example.com/foo?page=42 }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com | example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com | example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/foo | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/foo | link }} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo | link}} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/foo/ | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/foo/ | link }} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo/ | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo/ | link}} ('''Deprecated''')
|}
== Microformat ==
The template wraps the ''displayed'' URL with a <code>class="url"</code> so that it is included in any parent [[microformat]] which takes a URL parameter - see [[WP:UF|our microformats project]].
== TemplateData ==
{{TemplateDataHeader}}
<templatedata>
{
"description": "A template to display and format a URL",
"params": {
"1": {
"label": "URL",
"description": "The URL to be linked",
"type": "string",
"required": true
},
"2": {
"label": "Display text",
"description": "The text to be displayed instead of the URL. Deprecated",
"type": "string",
"required": false,
"deprecated": true
}
}
}
</templatedata>
== See also ==
* {{Tl|Official URL}}
* {{Tl|Official website}}
* {{Tl|Plain link}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:External link templates]]
}}</includeonly>
{{lua|Module:URL}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
This template can be used to create a formatted external link.
: ''Note - this template is for formatting the appearance of '''''displayed''''' URLs, while making them ''machine-readable'' as part of emitted [[microformat]] meta-data.
If you wish to display text instead of the URL (e.g. "[http://bbc.co.uk BBC website]" instead of {{URL|bbc.co.uk}}), please '''do not use this template'''.
For web-based references, please see [[Wikipedia:Citation templates]]''
== Usage ==
* <code><nowiki>{{URL|</nowiki>1=''url name''<nowiki>|</nowiki>2=''optional display text''<nowiki>}}</nowiki></code>
** The first parameter is parsed to see if it takes the form of a complete URL. If it doesn't start with a URI scheme (such as "http:", "https:", or "ftp:"), an "http://" prefix will be prepended to the specified generated target URL of the link.
** Parameter 2 is '''deprecated''' and should not be used.
'''Warning:''' The parameter 1 must be numbered explicitly if the URL contains an equal sign, as is common in the query string. This applies when the value of the URL is unknown, for example when this template is used in another template specifying the effective URL as a variable value. The ''deprecated'' second parameter for the displayed text, if present in legacy uses, '''must''' also be explicitly numbered if the first parameter is explicitly numbered; otherwise it will override the value of the first parameter.
'''Note:''' Instead of hard-coding the URL with this template, the URL can be fetched from the [[d:Property:P856|"Official website" property (P856)]] on [[Wikidata]] by using {{tlx|Official URL}}. Consider using that template, for infoboxes in particular.
=== Examples ===
{| class="wikitable"
|-
! Code !! Result
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki> }}</nowiki></code>
| {{ {{BASEPAGENAME}} }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| }}</nowiki></code>
| {{ {{BASEPAGENAME}} | }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| EXAMPLE.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | EXAMPLE.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| https://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | https://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| ftp://www.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | ftp://www.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| ftp://ftp.example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | ftp://ftp.example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/path }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/path }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| irc://irc.example.com/channel }}</nowiki></code>
| {{ {{BASEPAGENAME}} | irc://irc.example.com/channel }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/path/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/path/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo/ }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo/ }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| 1=http://www.example.com/path?section=17 }}</nowiki></code>
| {{ {{BASEPAGENAME}} | 1=http://www.example.com/path?section=17 }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| 1=www.example.com/foo?page=42 }}</nowiki></code>
| {{ {{BASEPAGENAME}} | 1=www.example.com/foo?page=42 }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com | example.com }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com | example.com }}
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/foo | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/foo | link }} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo | link}} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| http://www.example.com/foo/ | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | http://www.example.com/foo/ | link }} ('''Deprecated''')
|-
| <code><nowiki>{{</nowiki> {{BASEPAGENAME}} <nowiki>| www.example.com/foo/ | link }}</nowiki></code>
| {{ {{BASEPAGENAME}} | www.example.com/foo/ | link}} ('''Deprecated''')
|}
== Microformat ==
The template wraps the ''displayed'' URL with a <code>class="url"</code> so that it is included in any parent [[microformat]] which takes a URL parameter - see [[WP:UF|our microformats project]].
== TemplateData ==
{{TemplateDataHeader}}
<templatedata>
{
"description": "A template to display and format a URL",
"params": {
"1": {
"label": "URL",
"description": "The URL to be linked",
"type": "string",
"required": true
},
"2": {
"label": "Display text",
"description": "The text to be displayed instead of the URL. Deprecated",
"type": "string",
"required": false,
"deprecated": true
}
}
}
</templatedata>
== See also ==
* {{Tl|Official URL}}
* {{Tl|Official website}}
* {{Tl|Plain link}}
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<!-- Categories below this line, please; interwikis at Wikidata -->
[[Category:External link templates]]
}}</includeonly>