Template:URL/doc: Difference between revisions

From VNDev Wiki
Initial
 
m Removed broken link to wikipedia reference page
 
Line 1: Line 1:
{{Documentation subpage}}
{{Documentation subpage}}


This template creates a formatted external link. It formats the appearance of '''''displayed''''' URLs, while making them ''machine-readable'' as part of emitted [[microformat]] meta-data, inside templates such as infoboxes.
This template creates a formatted external link. It formats the appearance of '''''displayed''''' URLs, while making them ''machine-readable'' as part of emitted microformat meta-data, inside templates such as infoboxes.


'''Note:''' If you wish to display text instead of the URL (e.g. [https://example.com website] instead of {{URL|example.com}}), please '''do not use this template'''. Instead, consider using normal [[Wikipedia:Help:Link#External_links|wiki markup]].
'''Note:''' If you wish to display text instead of the URL (e.g. [https://example.com website] instead of {{URL|example.com}}), please '''do not use this template'''. Instead, consider using normal [[Wikipedia:Help:Link#External_links|wiki markup]].

Latest revision as of 16:05, 18 June 2022

This template creates a formatted external link. It formats the appearance of displayed URLs, while making them machine-readable as part of emitted microformat meta-data, inside templates such as infoboxes.

Note: If you wish to display text instead of the URL (e.g. website instead of http://example.com), please do not use this template. Instead, consider using normal wiki markup.

Usage

  • {{URL|example.com}}
    • The first parameter is parsed to decide whether it is a complete URL. If it doesn't start with a URI scheme (such as "http:", "https:", or "ftp:"), the prefix "http://" is prepended to the specified generated target URL of the link.

URL with = character should use numbered parameters

If the URL contains an equals sign, as is common in a query string, the parameter |1= should be used for the URL ({{URL|1=example.com}}). 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 {{URL|1=https://example.com/?id=42}}

The template attempts to handle simple cases where a URL containing an equals sign is specified without the necessary |1=, but it is still better practice to pass it in.