Difference between revisions of "Related"

(commenting)
m
(40 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{#vardefine:related|{{#switch:{{lc:{{{3|}}}}}<!-- check format -->
+
<includeonly>{{#if:{{{notext|}}}||<!-- only display below text if 'notext' isn't used -->
|row
+
==Related==
|rows=<!-- Skill row format
+
The following can affect (or are affected by) a character's {{sc|{{ambiguate|{{{2}}}}}}}.
-->{{#ask: [[Category:{{ucfirst:{{lc:{{{1}}}}}}}]]<!-- get pages in corresponding category
+
}}
--> [[Has stat::{{{2}}}]]<!-- get pages with corresponding stat -->
+
{{#arraydefine:categories|{{{1}}}}}<!-- split comma-separated list into array
| ?Has icon
+
-->{{#arrayprint:categories||@|
| ?Has skill name
+
{{#vardefine:category|{{sc|@}}}}<!-- get proper capitalization -->
| ?Has description
+
{{#if:{{{notext|}}}||<!-- only display below text if 'notext' isn't used -->
| sort=Has skill order
+
​<!-- zero-width space character to render the subheading correctly -->
| order=asc
+
==={{#var:category}}===
| format=template
+
}}
| template=Skill row format}}
+
{{#vardefine:result<!-- define result
|table
+
-->|{{#switch:{{#var:category}}<!-- switch the table used based upon the category
|#default=<!-- SkillListTable format
+
-->|Skills=<!-- Category:Skills
-->{{#ask: [[Category:{{ucfirst:{{lc:{{{1}}}}}}}]]<!-- get pages in corresponding category
+
-->{{#ask: [[Category:{{#var:category}}]]<!-- get pages in corresponding category
--> [[Has stat::{{{2}}}]]<!-- get pages with corresponding stat -->
+
-->{{#ifeq:{{{2|}}}|{{{2}}}<!-- if second parameter exists
 +
-->|[[Has stat::?;?;{{#replace:{{sc|{{{2}}}}}|&nbsp;|_}}]]}}<!-- only get pages with corresponding stat -->
 
| ?Has icon
 
| ?Has icon
 
| ?Has skill name
 
| ?Has skill name
Line 28: Line 29:
 
| order=asc
 
| order=asc
 
| format=template
 
| format=template
| template=SkillListTableBody
+
| introtemplate=Skill table header
| introtemplate=SkillListTableHeader
+
| template=Skill table body
| outrotemplate=SkillListTableFooter
+
| outrotemplate=Table footer
}}}}}}
+
| link=none
{{#if:{{#var:related}}<!-- if related pages exist
+
}}
-->|{{#var:related}}<!-- print related pages
+
|Passive&nbsp;Talents=<!-- Category:Passive talents
-->|'''No related {{{1}}}.'''}}<!-- else print no related pages
+
-->{{#ask: [[Category:{{#var:category}}]]<!-- get pages in corresponding category
--></includeonly><noinclude>{{{{PAGENAME}}/Documentation}}</noinclude>
+
-->{{#ifeq:{{{2|}}}|{{{2}}}<!-- if second parameter exists
 +
-->|[[Has stat::?;?;{{#replace:{{sc|{{{2}}}}}|&nbsp;|_}}]]}}<!-- only get pages with corresponding stat -->
 +
| ?Has talent name
 +
| ?Has stat|+index=3
 +
| ?Has stat|+index=2
 +
| 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>

Revision as of 14:48, 17 February 2024

Description

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

Usage

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

Parameters

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

Invalid category. Check documentation.