Wynncraft Wiki
SLScool (talk | contribs)
(Simplified the defining of the coordinate variables, fixed a specific instance where it wouldn't work, and added comments to explain stuff)
Tags: Mobile edit, Mobile web edit
Line 1: Line 1:
<includeonly>{{#if:{{trim|{{#explode: {{{coordinates|}}} |,| 2 }}}}|{{#vardefine:x|{{{x|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 0 }}}}}}{{#vardefine:y|{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 1 }}}}}}{{#vardefine:z|{{{z|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 2 }}}}}}|{{#vardefine:x|{{{x|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 0 }}}}}}{{#vardefine:y|}}{{#vardefine:z|{{{z|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 1 }}}}}}}}<!--
+
<includeonly>{{#vardefine:x|{{{x|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 0 }}}}}}<!--Defines the x-coordinate variable as the x parameter or the first number in the coordinates parameter
  +
-->{{#vardefine:z|{{{z|}}}{{trim|{{#explode: {{{coordinates|}}} |,| -1 }}}}}}<!--Defines the z-coordinate variable as the z parameter if it exists or the last number in the coordinates parameter
  +
-->{{#if:{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 2 }}}}|{{#vardefine:y|{{{y|}}}{{trim|{{#explode: {{{coordinates|}}} |,| 1 }}}}}}<!--If the y parameter is used or if there are three numbers in the coordinates parameter, then the y-coordinate variable is defined as the y parameter or the second number in the coordinates parameter
 
-->{| style="{{{style|}}} text-align: center; {{#if:{{{image_only|}}}||margin: 8px;}} border: 1px solid #333333; padding: 0; min-width: 150px; {{#if:{{{inline-block|}}}|display: inline-block;}}"
 
-->{| style="{{{style|}}} text-align: center; {{#if:{{{image_only|}}}||margin: 8px;}} border: 1px solid #333333; padding: 0; min-width: 150px; {{#if:{{{inline-block|}}}|display: inline-block;}}"
 
{{#if:{{{image_only|}}}||{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"{{!}} '''{{{locationLabel|Location}}}'''
 
{{#if:{{{image_only|}}}||{{!}}style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"{{!}} '''{{{locationLabel|Location}}}'''

Revision as of 18:09, 19 August 2021

Template-info.png Documentation

A location and coordinate display template similar to Template:Location, but has a different appearance. Most importantly, it also renders a portion of File:TopographicMap.jpg with a red crosshair on the coordinates, giving the reader a visual idea of where the coordinates are in the world.

Usage

All of the parameters are the same between this template and Template:Location, so swapping between the two templates is easy.

{{RenderLocation
<!-- REQUIRED PARAMETERS -->
| locationLabel = 
| location =
| coordinates = comma-separated list
OR
| x = 
| y = 
| z = 

<!-- OPTIONAL PARAMETERS -->
| width =
| height = 
| no_crosshair = 
| image_only = 
| inline-block = 
| style =
}}
  • locationLabel - defaults to "Location". Controls the bolded header text at the top of the display.
  • location - Controls the location name next to the coordinates.
  • coordinates or xyz - the coordinate input. You can either input a comma-separated list of coordinates, or input each coordinate individually.

The following parameters are optional and should not be used in most cases. They can be used to really customize the display.

  • width and height - Optional. Controls the width and height of the area to display.
  • no_crosshair - Optional. If true, doesn't render a red crosshair in the center of the image.
  • image_only - Optional. If true, doesn't display the location label, coordinates, or Wynncraft Map link, only the image.
  • inline-block - Optional. If true, gives the table the "display: inline-block" styling. Essentially, this makes consecutive RenderLocations appear beside each other instead of on new lines.
  • style - Optional. Use for any other css properties you want to define for the table.

Examples

{{RenderLocation
| location = Tolem
| coordinates = -1663, 53, -5271	
}}

{{#if:-5271|{| style=" text-align: center; margin: 8px; border: 1px solid #333333; padding: 0; min-width: 150px; " |style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"| Location |- |style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a;"|Tolem
-1663, 53, -5271 |-

|
PinpointConcept2.png

|- |style="border-top: 1px solid #333333" |Wynncraft Map |}

{{RenderLocation
| locationLabel = Spawn Node
| location = Gateway to Nothing
| coordinates = 1199, 75, -967
}}

{{#if:-967|{| style=" text-align: center; margin: 8px; border: 1px solid #333333; padding: 0; min-width: 150px; " |style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a; font-size: 120%"| Spawn Node |- |style="line-height:1.5; background: #5f9433; color: #FFFFFF; text-shadow: 0 1px 2px #89d44a;"|Gateway to Nothing
1199, 75, -967 |-

|
PinpointConcept2.png

|- |style="border-top: 1px solid #333333" |Wynncraft Map |}

{{RenderLocation
| locationLabel = Town
| location = Nemract
| coordinates = 128, 48, -2197
| width = 500
| height = 400
| no_crosshair = yes
| image_only = yes
}}

{{#if:-2197|{| style=" text-align: center; border: 1px solid #333333; padding: 0; min-width: 150px; "

|

|- |}