Template:Categorize Location: Difference between revisions

From HorizonXI Wiki
(changed category scheme from "X basecategory" to "basecategory/X")
(put code that identifies location in own template and switch compares now against expressions with underscore instead of spaces)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly><onlyinclude>{{categorize|{{{1|}}}|<!--
<includeonly><onlyinclude>{{categorize|{{{1|}}}|<!--
-->{{#switch:{{lc:{{#sub:{{#explode:{{#explode:{{{location}}}|,|0}}|(|0}}|2|-2}}}}
-->{{#switch:{{#replace:{{lc:{{Location/Reverse|{{{location}}}}}}}||_}}<!--
| southern san d'oria = [[Category:{{{category type|}}}/Southern San d'Oria]][[Category:{{{category type|}}}/San d'Oria]]
 
| northern san d'oria = [[Category:{{{category type|}}}/Northern San d'Oria]][[Category:{{{category type|}}}/San d'Oria]]
sandoria
| port san d'oria = [[Category:{{{category type|}}}/Port San d'Oria]][[Category:{{{category type|}}}/San d'Oria]]
-->
| bastok markets = [[Category:{{{category type|}}}/Bastok Markets]][[Category:{{{category type|}}}/Bastok]]
| southern_san_d'oria = [[Category:Southern San d'Oria/{{{category type|}}}]][[Category:San d'Oria/{{{category type|}}}]]
| bastok mines = [[Category:{{{category type|}}}/Bastok Mines]][[Category:{{{category type|}}}/Bastok]]
| northern_san_d'oria = [[Category:Northern San d'Oria/{{{category type|}}}]][[Category:San d'Oria/{{{category type|}}}]]
| port bastok = [[Category:{{{category type|}}}/Port Bastok]][[Category:{{{category type|}}}/Bastok]]
| port_san_d'oria = [[Category:Port San d'Oria/{{{category type|}}}]][[Category:San d'Oria/{{{category type|}}}]]
| metalworks | bastok metalworks = [[Category:{{{category type|}}}/Metalworks]][[Category:{{{category type|}}}/Bastok]]
| chateau_d'oraguille = [[Category:Chateau d'Oraguille/{{{category type|}}}]][[Category:San d'Oria/{{{category type|}}}]]<!--
| windurst waters = [[Category:{{{category type|}}}/Windurst Waters]][[Category:{{{category type|}}}/Windurst]]{{#if:{{#explode:{{#explode:{{{location}}}|(|0}}|,|1}}|<!--
 
-->[[Category:{{{category type|}}}/Windurst Waters ({{#sub:{{#explode:{{#explode:{{#explode:{{{location}}}|(|0}}|,|1}}|{{!}}|1}}|0|-2}})]]<!---->|}}
bastok
| windurst walls = [[Category:{{{category type|}}}/Windurst Walls]][[Category:{{{category type|}}}/Windurst]]
-->
| windurst woods = [[Category:{{{category type|}}}/Windurst Woods]][[Category:{{{category type|}}}/Windurst]]
| bastok_markets = [[Category:Bastok Markets/{{{category type|}}}]][[Category:Bastok/{{{category type|}}}]]
| port windurst = [[Category:{{{category type|}}}/Port Windurst]][[Category:{{{category type|}}}/Windurst]]
| bastok_mines = [[Category:Bastok Mines/{{{category type|}}}]][[Category:Bastok/{{{category type|}}}]]
| port jeuno = [[Category:{{{category type|}}}/Port Jeuno]][[Category:{{{category type|}}}/Jeuno]]
| port_bastok = [[Category:Port Bastok/{{{category type|}}}]][[Category:Bastok/{{{category type|}}}]]
| lower jeuno = [[Category:{{{category type|}}}/Lower Jeuno]][[Category:{{{category type|}}}/Jeuno]]
| metalworks | bastok_metalworks = [[Category:Metalworks/{{{category type|}}}]][[Category:Bastok/{{{category type|}}}]]<!--
| upper jeuno = [[Category:{{{category type|}}}/Upper Jeuno]][[Category:{{{category type|}}}/Jeuno]]
 
| ru'lude gardens = [[Category:{{{category type|}}}/Ru'Lude Gardens]][[Category:{{{category type|}}}/Jeuno]]
windurst: Getting the map part for South/North is not part of Template:Location/Reverse so individual code is needed.
| al zahbi = [[Category:{{{category type|}}}/Al Zahbi]][[Category:{{{category type|}}}/Aht Urhgan]]
-->
| aht urhgan whitegate = [[Category:{{{category type|}}}/Aht Urhgan Whitegate]][[Category:{{{category type|}}}/Aht Urhgan]]
| windurst_waters = [[Category:Windurst Waters/{{{category type|}}}]][[Category:Windurst/{{{category type|}}}]]{{#if:{{#explode:{{#explode:{{{location}}}|(|0}}|,|1}}|<!--
| #default = {{#ifexist:{{#sub:{{#explode:{{#explode:{{{location}}}|,|0}}|(|0}}|2|-2}}|[[Category:{{{category type|}}}/{{#sub:{{#explode:{{#explode:{{{location}}}|,|0}}|(|0}}|2|-2}}]]}}}}<!--
-->[[Category:Windurst Waters ({{#sub:{{#explode:{{#explode:{{#explode:{{{location}}}|(|0}}|,|1}}|{{!}}|1}}|0|-2}})/{{{category type|}}}]]<!---->|}}
| windurst_walls = [[Category:Windurst Walls/{{{category type|}}}]][[Category:Windurst/{{{category type|}}}]]
| windurst_woods = [[Category:Windurst Woods/{{{category type|}}}]][[Category:Windurst/{{{category type|}}}]]
| port_windurst = [[Category:Port Windurst/{{{category type|}}}]][[Category:Windurst/{{{category type|}}}]]
| heavens_tower = [[Category:Heavens Tower/{{{category type|}}}]][[Category:Windurst/{{{category type|}}}]]<!--
 
jeuno
-->
| port_jeuno = [[Category:Port Jeuno/{{{category type|}}}]][[Category:Jeuno/{{{category type|}}}]]
| lower_jeuno = [[Category:Lower Jeuno/{{{category type|}}}]][[Category:Jeuno/{{{category type|}}}]]
| upper_jeuno = [[Category:Upper Jeuno/{{{category type|}}}]][[Category:Jeuno/{{{category type|}}}]]
| ru'lude_gardens = [[Category:Ru'Lude Gardens/{{{category type|}}}]][[Category:Jeuno/{{{category type|}}}]]<!--
 
aht urhgan
-->
| al_zahbi = [[Category:Al Zahbi/{{{category type|}}}]][[Category:Aht Urhgan/{{{category type|}}}]]
| nashmau = [[Category:Nashmau/{{{category type|}}}]][[Category:Aht Urhgan/{{{category type|}}}]]
| aht_urhgan_whitegate = [[Category:Aht Urhgan Whitegate/{{{category type|}}}]][[Category:Aht Urhgan/{{{category type|}}}]]<!--
 
outlands (kazham, norg, rabao and some odd quests outside of towns  | yuhtunga jungle | cape teriggan | the sanctuary of zi'tah | the shrine of ru'avitau | eastern altepa desert  ) - see e.g. https://www.bg-wiki.com/ffxi/Category:Outlands_Quests
-->
| kazham | norg | rabao = [[Category:{{Location/Reverse|{{{location}}}}}/{{{category type|}}}]][[Category:Outlands/{{{category type|}}}]]<!--
 
others (mhaura, selbina, tavnazia and some odd quests outside of towns) - yes it's an official category, see e.g. https://www.bg-wiki.com/ffxi/Category:Other_Quests
-->
| mhaura | selbina | tavnazian_safehold = [[Category:{{Location/Reverse|{{{location}}}}}/{{{category type|}}}]][[Category:Other/{{{category type|}}}]]<!--
 
rest
-->
| #default = {{#ifexist:{{Location/Reverse|{{{location}}}}}|[[Category:{{Location/Reverse|{{{location}}}}}/{{{category type|}}}]]}}}}<!--
-->}}</onlyinclude></includeonly>
-->}}</onlyinclude></includeonly>
==Usage==
==Usage==
Line 38: Line 67:
</pre>
</pre>


''will categorize the page as '' [[:Category:Quests/Selbina]]
''will categorize the page as '' [[:Category:Selbina/Quests]] ''and'' [[:Category:Other/Quests]]


<pre>
<pre>
Line 47: Line 76:
</pre>
</pre>


''will categorize the page as ''[[:Category:Quests/Southern San d'Oria]] ''and'' [[:Category:Quests/San d'Oria]]
''will categorize the page as ''[[:Category:Southern San d'Oria/Quests]] ''and'' [[:Category:San d'Oria/Quests]]


<pre>
<pre>
Line 56: Line 85:
</pre>
</pre>


''will categorize the page as ''[[:Category:NPCs/Southern San d'Oria]] ''and'' [[:NPCs/Category:San d'Oria]]
''will categorize the page as ''[[:Category:Southern San d'Oria/NPCs]] ''and'' [[:Category:San d'Oria/NPCs]]

Latest revision as of 12:11, 19 September 2024

Usage

Template used to categorize according to a location. Arguments:

  • location: expects a Template:Location return.
  • category type: actual category type which is put after the location

Note: The template does not return anything, only categorizes based on the location input to the chosen type category of that area.

For city areas, will categorize to the city as well as the specific map/part of the city.

Examples

{{Categorize Location
|location={{Location|Selbina|H-7}}
|category type=Quests
}}

will categorize the page as Category:Selbina/Quests and Category:Other/Quests

{{Categorize Location
|location={{Location|Southern San d'Oria|H-7}}
|category type=Quests
}}

will categorize the page as Category:Southern San d'Oria/Quests and Category:San d'Oria/Quests

{{Categorize Location
|location={{Location|Southern San d'Oria|H-7}}
|category type=NPCs
}}

will categorize the page as Category:Southern San d'Oria/NPCs and Category:San d'Oria/NPCs