Template:TTURL/doc

From Angelina Jordan Wiki
Revision as of 05:42, 19 December 2023 by Dcljr (talk | contribs) (misc ce)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a subpage documenting Template:TTURL. To change the template, edit that page; to change the template's documentation (seen below), edit this one.

Documentation

This template constructs URLs for TikTok links. It shouldn't really be used directly by editors but by other, more useful templates that editors can use.

The name is based on the phrase "TikTok URL".

Usage

  • {{TTURL}}
  • {{TTURL|path}}
  • {{TTURL|path|protocol=http: or https: or nothing}}
  • {{TTURL|path=}}
  • {{TTURL|path=|protocol=http: or https: or nothing}}

The "path" refers to everything after "tiktok.com/" in the URL of the TikTok page you want to link to. If the path contains an equals sign (which is very unlikely), you should either "name" the positional parameter 1= in your template call (if you are trying to use the first or second form above) or use the explicitly-named parameters in the third or fourth form. Otherwise the equals sign will be interpreted as separating a parameter name from its value, resulting in a malformed link.

Note that protocol-relative URLs are formed by default, as seen in the examples below. When used to form live links, this means someone browsing the wiki in non-secure mode will get links beginning with http: and someone browsing in secure mode will get links begnning with https:. (But note that currently this wiki can only be browsed in secure mode.) This behavior can be overridden by using the protocol parameter (the value of which must include the final colon, when specified).

Examples

  • {{TTURL}} ⇒ //www.tiktok.com/
  • {{TTURL|@angelinajordana}} ⇒ //www.tiktok.com/@angelinajordana
  • {{TTURL|@angelinajordana/video/6998398571565321477}} ⇒ //www.tiktok.com/@angelinajordana/video/6998398571565321477
  • {{TTURL|path=@angelinajordana/video/6998398571565321477|protocol=https:}}https://www.tiktok.com/@angelinajordana/video/6998398571565321477

Notice how the protocol-relative bare URLs are not automatically linked, as seen in the first three examples, but URLs starting with http: or https: are autolinked by the MediaWiki software (the fourth example), unless they are surrounded by square brackets, as illustrated below.

Here's what the same examples look like when forming external links using square brackets:

  • [{{TTURL}}][1]
  • [{{TTURL|@angelinajordana}}][2]
  • [{{TTURL|@angelinajordana/video/6998398571565321477}}][3]
  • [{{TTURL|path=@angelinajordana/video/6998398571565321477|protocol=https:}}][4]