Template:Location: Difference between revisions

From HorizonXI Wiki
No edit summary
(made code more readable with comments and removed template position but called template tooltip directly)
Line 1: Line 1:
<includeonly><onlyinclude>{{#if:{{{1|}}}|[[{{{1|}}}]]{{#if:{{{map|}}}|, {{#switch:{{lc:{{{map link|}}}}}|none = {{{map}}}| = [[{{{1}}}/Maps#{{{map}}}|{{{map}}}]]|#default = [[{{{map link|}}}|{{{map}}}]]}}}}{{#if:{{{2|}}}|<nowiki> </nowiki>{{Position|{{{1|}}}|{{{2|}}}|{{{map|}}}|id={{{id|}}}|map link={{{map link|}}}|exact pos x={{{exact pos x|}}}|exact pos y={{{exact pos y|}}}}}}}{{#if:{{{3|}}}|
<includeonly><onlyinclude><!--
:''{{{3|}}}''<nowiki> </nowiki>}}}}</onlyinclude></includeonly>
 
display link to the area
-->{{#if:{{{1|}}}|[[{{{1|}}}]]<!--
 
additionally display map link in case its on an extra map
-->{{#if:{{{map|}}}|, {{#switch:{{lc:{{{map link|}}}}}|none = {{{map}}}| = [[{{{1}}}/Maps#{{{map}}}|{{{map}}}]]|#default = [[{{{map link|}}}|{{{map}}}]]}}}}<!--
 
display coordinates as link to the map and showing the map as a tooltip with position indicator using {{Location Tooltip}}
-->{{#if:{{{2|}}}|<nowiki> </nowiki><!--
 
Location Tooltip template
-->({{#switch:{{lc:{{{map link|}}}}}|none = {{{2}}}|#default = {{Location Tooltip|id={{{id|}}}|area={{{1}}}|pos={{{2}}}|map={{{map|}}}|exact pos x={{{exact pos x|}}}|exact pos y={{{exact pos y|}}}}}}})<!--
 
-->}}<!--
 
additional note display, if given
-->{{#if:{{{3|}}}|
:''{{{3}}}''<nowiki> </nowiki>}}}}</onlyinclude></includeonly>
[[Category:Templates|{{PAGENAMEE}}]]
[[Category:Templates|{{PAGENAMEE}}]]
==Usage==
==Usage==
Line 21: Line 38:
|-
|-
| <pre>{{Location|Northern San d'Oria|C-8}}</pre>
| <pre>{{Location|Northern San d'Oria|C-8}}</pre>
| {{Location|Northern San d'Oria|C-8}} text
| {{Location|Northern San d'Oria|C-8}}
|-
|-
| <pre>{{Location|Valkurm Dunes|H-7|Next to the outpost.}}</pre>
| <pre>{{Location|Valkurm Dunes|H-7|Next to the outpost.}}</pre>

Revision as of 17:28, 21 April 2024

Usage

{{Location|<area>|<position>|<note>|map=<map>|map link=<map link>}}

Provides a link to the map of a specified area map. Supports coordinates and areas with multiple maps. Notes appear on a new line in italics. Implemented using Template:Position.

  • area: The area to link to.
  • position: The position on the map.
  • note: Optional. A note about the location, such as landmarks that it is near.
  • map: Optional. The map that the location appears on.
  • id: Optional. A unique id to give to the tooltip. Use if the same location (area and position) is repeated on the same page.
  • map link: Optional. A link to the map that the location appears on or "none" to remove the automatic link.
  • exact pos x: Optional. The exact x position within the quadrant.
  • exact pos y: Optional. The exact y position within the quadrant.

Examples

Code Result
{{Location|Northern San d'Oria|C-8}}
Northern San d'Oria (C-8)
{{Location|Valkurm Dunes|H-7|Next to the outpost.}}
Valkurm Dunes (H-7)
Next to the outpost.
{{Location|Windurst Waters|map=North|K-6}}
Windurst Waters, North (K-6)
{{Location|Inner Horutoto Ruins|map=Lily Tower|map link=Lily Tower|I-9}}
Inner Horutoto Ruins, Lily Tower (I-9)
{{Location|Ifrit's Cauldron|map=Map 5|map link=none|F-8}}
Ifrit's Cauldron, Map 5 (F-8)
{{Location|Bastok Markets|F-10|exact pos x=10|exact pos y=8}}
Bastok Markets (F-10)

Exact position coordinates place a red pixel graphic at the coordinates in the tooltip. The alignment is to the top left of a transparent gif and not the center of it.