Difference between revisions of "Related"

m (Added format parameter)
m
 
(47 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{lc:{{{2|}}}}}
+
<includeonly>{{#if:{{{notext|}}}||<!-- only display below text if 'notext' isn't used -->
|row
+
==Related==
|rows={{#ask: [[Category:Skills]] [[Has stat::{{{1}}}]]
+
The following can affect (or are affected by) a character's {{sc|{{ambiguate|{{{2}}}}}}}.
| ?Has icon
+
}}
| ?Has skill name
+
{{#arraydefine:categories|{{{1}}}}}<!-- split comma-separated list into array
| ?Has description
+
-->{{#arrayprint:categories||@|
| sort=Has skill order
+
{{#vardefine:category|{{sc|@}}}}<!-- get proper capitalization -->
| order=asc
+
{{#if:{{{notext|}}}||<!-- only display below text if 'notext' isn't used -->
| format=template
+
​<!-- zero-width space character to render the subheading correctly -->
| template=Skill row format}}
+
==={{#var:category}}===
|table
+
}}
|#default={{#ask: [[Category:Skills]] [[Has stat::{{{1}}}]]
+
{{#vardefine:result<!-- define result
| ?Has icon
+
-->|{{#switch:{{#var:category}}<!-- switch the table used based upon the category
| ?Has skill name
+
-->|Skills=<!-- Category:Skills
| ?Has cast time
+
-->{{#ask: [[Category:{{#var:category}}]]<!-- get pages in corresponding category
| ?Has range
+
-->{{#ifeq:{{{2|}}}|{{{2}}}<!-- if second parameter exists
| ?Has cost
+
-->|[[Has stat::?;?;{{#replace:{{sc|{{{2}}}}}|&nbsp;|_}}]]}}<!-- only get pages with corresponding stat -->
| ?Has cost type
+
|?Has icon
| ?Has cooldown
+
|?Has skill name
| ?Is for hero
+
|?Has cast time
| ?Has mastery
+
|?Has range
| ?Has skill order
+
|?Has cost
| sort=Has skill order
+
|?Has cost type
| order=asc
+
|?Has cooldown
| format=template
+
|?Is for hero
| template=SkillListTableBody
+
|?Has mastery
| introtemplate=SkillListTableHeader
+
|?Has skill order
| outrotemplate=SkillListTableFooter
+
|sort=Has skill order
}}}}</includeonly><noinclude>{{Related skills/Documentation}}</noinclude>
+
|order=asc
 +
|format=template
 +
|introtemplate=Skill table header
 +
|template=Skill table body
 +
|outrotemplate=Table footer
 +
|link=none
 +
}}
 +
|Passive&nbsp;Talents=<!-- Category:Passive talents
 +
-->{{#ask: [[Category:{{#var:category}}]]<!-- get pages in corresponding category
 +
-->{{#ifeq:{{{2|}}}|{{{2}}}<!-- if second parameter exists
 +
-->|[[Has stat::?;?;{{#replace:{{sc|{{{2}}}}}|&nbsp;|_}}]]}}<!-- only get pages with corresponding stat -->
 +
|?Has icon
 +
|?Has branch
 +
|?Has tier
 +
|format=template
 +
|introtemplate=Talent table header
 +
|template=Talent table body
 +
|outrotemplate=Table footer
 +
|link=none
 +
}}
 +
|#default={{error|Invalid category. Check documentation.}}<!-- invalid category error
 +
-->}}}}
 +
{{#if:{{#var:result}}|{{#var:result}}|'''No {{#var:category}}.'''}}}}</includeonly><noinclude>{{{{PAGENAME}}/Documentation}}</noinclude>

Latest revision as of 21:03, 1 June 2024

Description[edit]

Displays a stylized list of all pages in the specified categories that contain the specified Stat.

Usage[edit]

{{Related|<category/categories>|<stat>|<notext=notext>}}

Parameters[edit]

Arrow.png1: The categories to query.
Required.
Notes: Comma separated, can be skills or passive talents
Arrow.png2: The stat to query.
Required.
Arrow.pngnotext: Whether or not to include descriptor text.
Optional.
Notes: If not set, the following text will display:
==Related==
The following can affect (or are affected by) a character's {{{2}}}.

[For each category, a stylized list and accompanying subheading will display.]

Errors[edit]

Invalid category. Check documentation.