Template:NPC/Region.dpl: Difference between revisions

From HorizonXI Wiki
(Created page with "<includeonly><onlyinclude>{{#dpl: | title=<!-- -->{{#explode:{{#dpl: | title={{{name}}} | include={Location}:1,{NPC}:name | layout=,,, }}|{{{name}}}}}<!-- --> | include={Zone Infobox}:Region | layout=,,, }}</onlyinclude></includeonly> ==Usage== Uses the NPCs location field to extract the location and subsequently looks at that location page and extracts the region (from region parameter of Template:Zone Infobox). Uses explode parser function with the name of the npc...")
 
(changed input to work with template location return instead of npc name)
Line 1: Line 1:
<includeonly><onlyinclude>{{#dpl:
<includeonly><onlyinclude>{{#dpl:
| title=<!--
| title=<!--
-->{{#explode:{{#dpl:
-->{{#sub:<!--
-->{{#explode:{{{location}}}|(|0}}<!--
-->|2|-2}}
| include={Zone Infobox}:Region
| layout=,,,
}}</onlyinclude></includeonly>
<!--{{#explode:{{#dpl:
| title={{{name}}}
| title={{{name}}}
| include={Location}:1,{NPC}:name
| include={Location}:1,{NPC}:name
| layout=,,,
| layout=,,,
}}|{{{name}}}}}<!--
}}|{{{name}}}}}
-->
-->
| include={Zone Infobox}:Region
| layout=,,,
}}</onlyinclude></includeonly>
==Usage==
==Usage==


Uses the NPCs location field to extract the location and subsequently looks at that location page and extracts the region (from region parameter of Template:Zone Infobox).  
Uses the NPCs location entry to extract the location and subsequently looks at that location page and extracts the region (from region parameter of Template:Zone Infobox).  


Uses explode parser function with the name of the npc to work around the possibility of having multiple Template:Location on the page and selecting only the first. Not the best workaround but couldn't find a way to do it better.  
Requires the location to be entered as a [[Template:Location]]. Uses explode parser function with the character "(" to split the return of [[Template:Location]] and obtain the area as the 0th argument of that.  


===Examle===
===Examle===
Line 21: Line 23:
[[Medicine Axe]] is a NPC at the Outpost of the Valkurm Dunes. The corresponding region is Zulkheim.  
[[Medicine Axe]] is a NPC at the Outpost of the Valkurm Dunes. The corresponding region is Zulkheim.  


<pre>{{Template:NPC/Region.dpl|name=Medicine Axe}}</pre>
<pre>{{Template:NPC/Region.dpl|location={{Location|Valkurm Dunes|H-7}}</pre>


{{Template:NPC/Region.dpl|name=Medicine Axe}}
{{Template:NPC/Region.dpl|location={{Location|Valkurm Dunes|H-7}}}}

Revision as of 02:12, 29 October 2023

Usage

Uses the NPCs location entry to extract the location and subsequently looks at that location page and extracts the region (from region parameter of Template:Zone Infobox).

Requires the location to be entered as a Template:Location. Uses explode parser function with the character "(" to split the return of Template:Location and obtain the area as the 0th argument of that.

Examle

Medicine Axe is a NPC at the Outpost of the Valkurm Dunes. The corresponding region is Zulkheim.

{{Template:NPC/Region.dpl|location={{Location|Valkurm Dunes|H-7}}

Zulkheim