Template:Def: Difference between revisions
Template page
More actions
No edit summary Tags: Mobile edit Mobile web edit |
No edit summary Tags: Mobile edit Mobile web edit |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
<templatestyles src="Template:def/styles.css" /> | <includeonly><templatestyles src="Template:def/styles.css" />{{#invoke:Definitions|def | ||
{{#invoke:Definitions|def | |{{{1|{{{Domain|{{{domain|}}}}}}}}} | ||
| {{{1|{{{Domain|{{{domain|}}}}}}}}} | |{{{2|{{{Key|{{{key|}}}}}}}}} | ||
| {{{2|{{{Key|{{{key|}}}}}}}}} | |noicon={{{noicon|{{{NoIcon|{{{3|}}}}}}}}} | ||
}} | |pill={{{pill|{{{Pill|}}}}}}} | ||
|fill={{{fill|{{{Fill|}}}}}}} | |||
<noinclude> | }}</includeonly><noinclude>{{/Doc}}[[Category:Templates]]</noinclude> | ||
{{/Doc}} | |||
[[Category:Templates]] | |||
</noinclude> | |||
Latest revision as of 16:41, 26 February 2026
Template:def
This template renders a Definitions v1 term using an explicit (Domain, Key) pair.
It calls Module:Definitions and resolves data from Module:Definitions/Definitions.json.
Usage
{{def|Domain|Key}}
Examples:
{{def|Stat|Vit}}
{{def|Element|Fire}}
{{def|Cast|Ground}}
{{def|Target|Summon}}
Parameters
- 1 (Domain)
- The definition domain. This value is required.
- 2 (Key)
- The definition key within the domain (CamelCase). This value is required.
Supported Domains (v1)
- Cast
- Damage
- Element
- Aura
- Event
- Stance
- Stat
- Target
Behavior
- If the record has a non-empty Definition, a tooltip is available (hover on desktop, tap on mobile).
- If Definition is empty, tooltip behavior is disabled.
- If Name is empty, the Key is displayed in a humanized form.
- If the record is missing, a missing placeholder is displayed.
- If Link is non-empty, the term text is rendered as a real clickable link.
Styling
- CSS is provided via TemplateStyles at: Template:def/styles.css
- CSS namespace: sv-def only
JavaScript
- Tooltip behavior is implemented in: MediaWiki:Common.js
Renders a Definitions v1 term using an explicit (Domain, Key) pair.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Domain | 1 | Definition domain. Supported v1 domains: Cast, Damage, Element, Aura, Event, Stance, Stat, Target.
| String | required |
| Key | 2 | Definition key within the domain (CamelCase). Example: Vit, Fire, Ground, Summon.
| String | required |