User:Lady Elyssa/Templates/Template:Skill fact query

From Guild Wars 2 Wiki
Jump to navigationJump to search

Derived from:


Example[edit]

Define our Query where:

Profession = Warrior
Elite =
Skill Type / Context = Utility
Boon = Fury



{{#vardefine:COREQUERY|{{#ask:[[Is for profession::{{#var:profession}}]] [[Category:{{#var:context}} skills]][[Has specialization sort order::0]][[Has subobject.Has fact::{{#var:boon}}]]}}}}
}}


To view the initial Query Result (not used within the actual template, used here as a demonstration example.

{{#var: COREQUERY}}

Unformatted Result: Banner of Discipline, "For Great Justice!"

Break our query result down and organise for display

Arraymap using our COREQUERY:
{{#arraymap: {{#var: COREQUERY}}
|,                           <!-- Seperate our Data by the (,) Delimeter -->
|@@@                         <!-- temporary string variable -->
|* {{#var: context}}: @@@    <!-- Cycle through each piece of data stored in variable -->
|\n                          <!-- Add newline to end of data segment -->
|
}}

Formatted Result: