Template:URL/doc

From VNDev Wiki

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.