Template:Tag
<tag>...</tag>
| This template, module and/or subpages are based on or ported over completely to BattleTechWiki, using the Creative Commons Licensed content from this page on Wikipedia (The original authors of this page are shown on here). |
{{tag|tagname [|type] [|content=text] [|attribs=attributes and values]}}
A markup tag is an open < and a close > angle brackets and the content within them, in a markup language, as XML or HTML:
- For example, the <title> tag provides a title for the Web page.
This template provides a quick way to mention a markup-style tag in a preformatted way. Mainly used in discussion/help pages.
Parameters[edit]
This template is for 'displaying' HTML/XML tags for elements with code markup. It can contain contents between the start and end tags, as well as attributes for the tag. (Note: To add markup tags, use the #tag magic word.)
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Tag name | 1 | XML/HTML tag's name. Use !-- for an HTML comment.
| String | required |
| Type | 2 | To indicate which of the tag's types is/are presented. For example, using "open" → <span>; "close" → </span>; "empty" → <br />. To suppress the ellipsis ("...") between the tags, add an empty "content" parameter → <span></span>
| String | suggested |
| Disable nowrap | wrap | Disable nowrap for long samples, so allowing wraps (line breaks or newlines).
| Boolean | optional |
| CSS style | style | Replace the default CSS style: border:none; background:transparent.
| String | optional |
| Link? | link | Link to the element's entry in the [[HTML element]] article, For example: {{Tag | del | link=y}} produces: "<[[HTML element#del | del]]>...</del>". This is only for HTML elements; the page for the link is hard-coded.
| Unknown | optional |
| params | params | no description | Unknown | optional |
| Attributes and values | attribs params | [[Attributes and values]] to be included as part of an open/start tag
| String | suggested |
| Content | content | Text to place between open/start and close/end tags. | String | suggested |
See also[edit]
- HTML tag
- {{HTMLElement}}
- {{XMLElement}}
- {{xtag}} adds a MediaWiki parser or extension tag that links to the extension page.
- #tag:, the parser function that generates working tags.
Other formatting templates[edit]
| Code example | Effect | Notes |
|---|---|---|
{{Tj|Hatnote|Some text|selfref: yes|category: no|lang: fr}}
|
Supports colors, placeholder texts, named and unnamed parameters | |
<syntaxhighlight lang="wikitext">
</syntaxhighlight>
|
Same as above | |
{{Tji|Hatnote|Some text|selfref: yes|category: no|lang: fr}}
|
{{Hatnote |
Supports colors, placeholder texts, named and unnamed parameters |
|
|
Same as above |
{{tln|Hatnote}}
|
Template:Hatnote | Produces a normal link to the template |
{{elc|Template:Hatnote}}{{elc|Template:Hatnote|Hatnote}}
|
[[Template:Hatnote]][[Template:Hatnote|Hatnote]] |
Formats wikilink, with optional piped link text and blended suffix |
{{ml|Example|hello}}
|
{{#invoke:Example|hello}} | Counterpart to {{tl}} for linking to Lua modules |
{{mfl|Example|hello}}
|
{{#invoke:Example|hello}} | Similar to {{ml}}, but expects the function to be documented and creates a link to the corresponding section |
{{mlx|Example|hello}}
|
{{#invoke:Example|hello}} |
Counterpart to {{tlx}} for linking to Lua modules |
{{ml-lua|Module:Example}}
|
require('Module:Example') |
Link to Lua modules and built-in libraries, showing Lua code. |
{{para|title|<var>book title</var>}}
|
title=book title | Formats template parameters for display, with or without values |
{{sclx|mos}}
|
[[BTW:MOS]] |
Takes a shortcut suffix in project namespace and displays it with brackets and the BTW: alias in a <code>...</code> tag.
|
{{tag|ref}}{{xtag|templatedata}}
|
<ref>...</ref><templatedata> |
Formats [X]HTML tags; can add content, choose opening, closing, or self-closing |
{{dtl|Ping project}}
|
Wikidata:Ping project]}} | Wikidata counterpart to {{tl}} |
{{pf|if}}{{pf|if|{{{1}}}|true|false}}
|
{{#if}} {{#if:{{{1}}}|true|false}} |
Parser function equivalent to {{tl}} |
{{magic word|uc:}}
|
{{uc:}} | Magic word links |

