Template:Format link
Page Module:Documentation/styles.css has no content.
Script error: No such module "High-use". Lua error in Module:Lua_banner at line 113: attempt to index field 'edit' (a nil value).
This template formats a link for use in hatnote templates. It accepts up to three positional parameters, the link, an optional display value, and an optional target override (which if provided, makes the link parameter optional). These parameters may also be supplied by name, as link, display, and target respectively. Links to categories and files are automatically escaped with the colon trick, and links to sections are automatically formatted as page § section, rather than the MediaWiki default of page#section.
Usage
Link only:
Link plus display:
Link with an italicized page name:
Link with an italicized section name:
If the link or display values contain an equals sign, you will need to specify the parameter names like this:
Link with a target override:
Link with parameters supplied by name:
URL formatting:
This template replaces any underscores with spaces and decodes any URL parts in Template:Tl's output. For example:
{{format linkr|People_of_the_Philippines_v._Santos,_Ressa_and_Rappler#Santos_Jr.'s_article|italicizepage=y}}
|nud= (no URL decode) can be added to disable URL decoding but still get underscores replaced:
{{format linkr|%E6%9C%AA%E6%9D%A5%E6%97%A5%E8%A8%98#M%61_nga|nud=y}}
Examples
- Template:Tlc → [[Lion]] → Script error: No such module "urldecode".
- Template:Tlc → [[Lion#Etymology|Lion § Etymology]] → Script error: No such module "urldecode".
- Template:Tlc → [[:Category:Lions]] → Script error: No such module "urldecode".
- Template:Tlc → [[Lion#Etymology|Etymology of lion]] → Script error: No such module "urldecode".
- Template:Tlc → [[:Foo#Bar|§ Bar]] → Script error: No such module "urldecode".
- Template:Tlc → [[Quo warranto#Philippines|<i>Quo warranto</i> § Philippines]] → Script error: No such module "urldecode".
- Template:Tlc → [[Cybercrime Prevention Act of 2012#Disini v. Secretary of Justice|Cybercrime Prevention Act of 2012 § <i>Disini v. Secretary of Justice</i>]] → Script error: No such module "urldecode".
- Template:Tlc → Script error: No such module "urldecode".
Errors
If this template is used and neither the link parameter (or positional parameter 1) nor the target parameter (or positional parameter 3) is supplied, then the template will return an error message. At least one of those must be supplied.
See also
- Template:Tl
- Template:Tl – a template for applying a Wikidata Script error: No such module "wd". (P1630)
TemplateData
TemplateData for Format link
This template simplifies the process of formatting links from the URL bar by automatically replacing underscores with spaces and decoding URL-encoded parts.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Page | 1 link | The name of the page the link points to. It can include a section after a hashtag (#).
| String | required |
| Display | 2 display | optional display value
| String | optional |
| Target | 3 target | optional target override (which if provided, makes the link parameter optional)
| String | optional |
| Italicize page | italicizepage | Set to 'y' to italicize the page name.
| String | optional |
| No URL Decode | nud | Set to 'y' to prevent URL decoding, while still replacing underscores with spaces.
| String | optional |
| keepunderscore | keepunderscore | no description | Unknown | deprecated |