Template:Form-url/doc

From Angelina Jordan Wiki
Revision as of 21:06, 12 July 2024 by Dcljr (talk | contribs) (template doc created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a subpage documenting Template:Form-url. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template forms full URLs from individual parts. It mostly exists to be called by other templates, but can be used to display a "bare URL" on a page, if that seems necessary. (Sometimes trying to "save" a page that has a bare URL on it can cause MediaWiki to flag the edit as spam. This may or may not be true on this wiki. In any case, if you have that problem, you can "hide" the URL from the spam filter by breaking it up and using this template.)

Usage

  • {{form-url|protocol|domain|path|query}}
  • {{form-url|protocol=|domain=|path=|query=}}

Note that the first positional parameter is the protocol to be used, not the domain (see the errors below). The protocol can be either https or http (or, well, other things, but nevermind).

Technically, none of the parameters are required, but at minimum a domain is necessary to result in a valid URL.

Examples

Note the empty first positional parameter in the first two examples. This means the protocol is not being specified, which results in protocol-relative URLs. As you can see, these are not automatically linked by MediaWiki, like bare HTTP and HTTPS links are.

The 3rd, 4th, and 5th examples show different ways you can specify a query string containing an equal sign (as they usually do).

Errors

  • {{form-url}} ⇒ ///
  • {{form-url|www.angelinajordanofficial.com|book}} ⇒ www.angelinajordanofficial.com://book/

The first example doesn't give a working URL. The second accidentally uses a domain in the position where the template expects a protocol.