Jump to content

Fyrimynd:Wikivar/doc

Frá Wikipedia, hin frælsa alfrøðin

This template facilitates the displaying of Wikipedia variables and built-in "magic word" (i.e. pseudo-template) names and, optionally, their :parameters. The variable/magic-word names are automatically uppercased:

{{wikivar|PAGENAME}} and {{wikivar|pagename}} both produce: {{PAGENAME}}

The second parameter supplied will be treated as the variable or magic word's parameter/s. For example:

{{DEFAULTSORT|Kusanagi, Motoko}} produces: {{DEFAULTSORT:Kusanagi, Motoko}}

To convert the variable or magic word's name into a link to the "Variables" section in Help:Magic words, set the parameter |link= as on / add / include / etc.  For example:

{{wikivar|link=on|PAGENAME}} produces: {{PAGENAME}}

To remove the default border and background, set |style= as plain:

{{wikivar|style=plain|link=on|PAGENAME}} produces: {{PAGENAME}}

|style= may also be set to one or more CSS styles that are then applied to the template's output.

Comparison

[rætta wikitekst]
Input Output
{{wikivar|PAGENAME}} {{PAGENAME}}
{{tld|PAGENAME}} {{PAGENAME}}
{{wikivar|link=on|PAGENAME}} {{PAGENAME}}
{{tlx|PAGENAME}} {{PAGENAME}}
{{wikivar|style=plain|PAGENAME}} {{PAGENAME}}
{{braces|PAGENAME}} {{PAGENAME}}
{{wikivar|DEFAULTSORT|Kusanagi, Motoko}} {{DEFAULTSORT:Kusanagi, Motoko}}
{{tld|DEFAULTSORT:Kusanagi, Motoko}} {{DEFAULTSORT:Kusanagi, Motoko}}