Template:Condition inline: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
(Updated documentation and added category)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{Condition|{{{1}}}|inline=t|altname={{{2|}}} |w={{{w|}}}}}</includeonly><noinclude>{{documentation|content={{shortcut|cond}}
<includeonly>{{#cargo_query: tables = conditions
Similar to [[Template:Condition]], but exclusively supports inline usage.
| fields = _pageName=page, name, icon, CONCAT('true') = inline, CONCAT('{{#replace:{{{2|}}}|'|\'}}') = altname, CONCAT('{{{w|25}}}') = w
| where = _pageName = "{{#replace:{{{1}}}|&#39;|\'}} (Condition)"
| format = template
| template = Condition/Format
| named args = yes
| limit = 1
| order by = _ID
| more results text=
| default = [[{{{1}}} (Condition)|{{{2|{{{1}}}}}}]]{{Main namespace only|[[Category:Pages with unknown conditions]]}}
}}</includeonly><noinclude>{{documentation|content={{shortcut|cond}}
This template creates an inline link to a condition page with an accompanying condition icon.


Example: <code><nowiki>{{Cond|Radiating Orb}}</nowiki></code>
== Usage ==
This template looks up conditions from the [[Special:CargoTables/conditions|conditions Cargo table]], and thus the first parameter should match an entry in this table. If provided, the second parameter changes the display name of the condition.
Specifying the optional {{c|w}} parameter changes the width of the icon (default 25).


Result: {{Cond|Radiating Orb}}
== Examples ==
{{Template demo
| style = table
| <nowiki>{{Cond|Radiating Orb}}</nowiki>
| <nowiki>{{Cond|Bleeding|Bleed}}</nowiki>
| <nowiki>{{Cond|Radiating Orb|w = 40}}</nowiki>
| <nowiki>{{Cond|Non-existent condition}}</nowiki>
}}


If provided, the second parameter changes the display name of the condition.
== See also ==
 
* {{t link|SAI}} - A similar template used for links to spells, abilities, and passives.
Example: <code><nowiki>{{Cond|Radiating Orb|Glowing}}</nowiki></code>
* {{t link|Condition}} - Displays more detailed information about a condition.
 
* {{t link|Condition page}} - Page generating template responsible for adding a condition into the condition Cargo table so that it can be referenced by this template.
Result: {{Cond|Radiating Orb|Glowing}}
 
[[Category:Condition templates]]


== Template data ==
== Template data ==
<templatedata>
<templatedata>
{
{
    "description": "Display a link to a condition accompanied by the condition icon.",
"params": {
"params": {
"1": {
"1": {
"label": "condition name",
"label": "condition name",
            "description": "The name of the condition as appears in the condition table. This should generally be the condition page name with \"(Condition)\" removed.",
"type": "string",
"type": "string",
"required": true
"required": true
Line 28: Line 45:
"description": "Alternative display name",
"description": "Alternative display name",
"type": "string"
"type": "string"
},
        "w": {
            "label": "width",
"description": "Size in pixels of the condition icon. Generally, you should stick with the default value.",
            "default": "25",
"type": "number"
}
}
},
},
"format": "inline"
"format": "inline"
}
}
</templatedata>}}</noinclude>
</templatedata>}}
[[Category:Templates]]
[[Category:Link templates]]
[[Category:Condition templates]]
</noinclude>

Latest revision as of 22:27, 21 July 2024

Template documentation
Shortcut

This template creates an inline link to a condition page with an accompanying condition icon.

Usage

This template looks up conditions from the conditions Cargo table, and thus the first parameter should match an entry in this table. If provided, the second parameter changes the display name of the condition. Specifying the optional w parameter changes the width of the icon (default 25).

Examples

Markup Renders as
{{Cond|Radiating Orb}}
Radiating Orb Radiating Orb
{{Cond|Bleeding|Bleed}}
Bleed Bleed
{{Cond|Radiating Orb|w = 40}}
Radiating Orb Radiating Orb
{{Cond|Non-existent condition}}
Non-existent condition

See also

  • {{SAI}} - A similar template used for links to spells, abilities, and passives.
  • {{Condition}} - Displays more detailed information about a condition.
  • {{Condition page}} - Page generating template responsible for adding a condition into the condition Cargo table so that it can be referenced by this template.

Template data

Display a link to a condition accompanied by the condition icon.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
condition name1

The name of the condition as appears in the condition table. This should generally be the condition page name with "(Condition)" removed.

Stringrequired
altname2

Alternative display name

Stringoptional
widthw

Size in pixels of the condition icon. Generally, you should stick with the default value.

Default
25
Numberoptional