User:Galbus/sandbox/T:LocationList

From Lotro-Wiki.com
Jump to navigation Jump to search


Description

This template duplicates the LocationList template for development use.

Nested If statements explanation:

{{#if:{{{style}}}|  
^-- if style parameter exists then do the next line, otherwise apply the very last segment.
	{{#if:{{{style|}}}| 
	^-- if style parameter isn't empty do the next line, otherwise apply the next to last segment.
		{{#ifeq: {{{style}}}| "" | style="width: 100%;"| style={{{style}}} }}| 
		^-- if the parameter evaluates to an empty quoted string (which does happen) then it 
		applies default style, otherwise it sets the style to what the parameter specifies
	/** next to last segment **/ }}|
/** last segment **/  }}


{{#if:{{{class}}}| 
^-- if class parameter exists then do the next line, otherwise apply the very last segment.
	{{#if:{{{class|}}}| 
	^-- if class parameter isn't empty do the next line, otherwise apply the next to last segment.
		{{#ifeq: {{{class}}} | "" | class="altRowsPad locationList" | class="altRowsPad locationList {{#replace:{{{class}}}|"| }}" }}| 
		^-- if the parameter evaluates to an empty quoted string (which does happen) then it applies default 
			classes that are used on all LocationLists, otherwise it sets the class to the default classes 
			AND adds the ones that the editor specifies.
	class="altRowsPad locationList" }}| <-- next to last segment. 
	(NOTE: Admittedly the original was a sloppy copy/paste on my part. The original would have still 
	rendered correctly with an extra class entry in the class list.)
class="altRowsPad locationList" }}  <-- very last segment

This template is used to create a table that lists locations along with their coordinates and directions on how to find them. When the user hovers over one of the locations, the map will be shown with an indicator for the location, as well as dots for all other locations in the list.

Basic Usage

Class Inclusion

You can add predefined classes to the LocationList table using the class parameter.

Example

{{User:Galbus/sandbox/T:LocationList|class="sortable"
| The Shire | 29.8S | 74.7W | first location
| The Shire | 31.0S | 72.0W | second location
}}
Coordinates Directions / Description
[29.8S, 74.7W] first location
[31.0S, 72.0W] second location

Custom Style

You can add a custom style to the LocationList table using the style parameter.

Example

{{User:Galbus/sandbox/T:LocationList|style="padding-left:1.5em;"
| The Shire | 29.8S | 74.7W | first location
| The Shire | 31.0S | 72.0W | second location
}}
Coordinates Directions / Description
[29.8S, 74.7W] first location
[31.0S, 72.0W] second location