Difference between revisions of "Related"

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