Difference between revisions of "Template:Infobox hiking trail"

From LongTrailsWiki
Jump to navigation Jump to search
(Tried to add direction of Travel to Template)
(Add fields and variables, osm_relation_link, wikidata_link)
 
(7 intermediate revisions by 2 users not shown)
Line 30: Line 30:
 
| label10=Designation
 
| label10=Designation
 
| data10={{{designation|}}}
 
| data10={{{designation|}}}
| label13=Trailsheads
+
| label13=[[Trailheads]]
 
| data13={{{trailheads|}}}
 
| data13={{{trailheads|}}}
| label14=Use
 
| data14={{{use|}}}
 
 
| header15={{#if:{{{embed|}}}||{{#if:{{{elev_gain_and_loss|}}}{{{elev_change|}}}{{{elev_change_m|}}}{{{elev_change_ft|}}}{{{highest_name|}}}{{{highest_m|}}}{{{highest_ft|}}}{{{highest|}}}{{{lowest_name|}}}{{{lowest_m|}}}{{{lowest_ft|}}}{{{lowest|}}}{{{grade|}}}|Elevation}} }}
 
| header15={{#if:{{{embed|}}}||{{#if:{{{elev_gain_and_loss|}}}{{{elev_change|}}}{{{elev_change_m|}}}{{{elev_change_ft|}}}{{{highest_name|}}}{{{highest_m|}}}{{{highest_ft|}}}{{{highest|}}}{{{lowest_name|}}}{{{lowest_m|}}}{{{lowest_ft|}}}{{{lowest|}}}{{{grade|}}}|Elevation}} }}
 
| label16=Elevation gain/loss
 
| label16=Elevation gain/loss
 
| data16={{{elev_gain_and_loss|}}}
 
| data16={{{elev_gain_and_loss|}}}
| label17=Elevation change
+
| label17=[[Elevation|Elevation change]]
 
| data17={{#if:{{{elev_change|}}}|{{{elev_change}}}<!---
 
| data17={{#if:{{{elev_change|}}}|{{{elev_change}}}<!---
 
     -->|{{convinfobox|{{{elev_change_m|}}}|m|{{{elev_change_ft|}}}|ft}} }}
 
     -->|{{convinfobox|{{{elev_change_m|}}}|m|{{{elev_change_ft|}}}|ft}} }}
Line 44: Line 42:
 
| label19=Lowest point
 
| label19=Lowest point
 
| data19={{comma separated entries|{{{lowest_name|}}}|{{convinfobox|{{{lowest_m|}}}|m|{{{lowest_ft|}}}|ft}}|{{{lowest|}}} }}
 
| data19={{comma separated entries|{{{lowest_name|}}}|{{convinfobox|{{{lowest_m|}}}|m|{{{lowest_ft|}}}|ft}}|{{{lowest|}}} }}
| label20=Grade
+
| label20=[[Grade (slope)|Grade]]
 
| data20={{{grade|}}}
 
| data20={{{grade|}}}
 
| header21={{#if:{{{embed|}}}||{{#if:{{{difficulty|}}}{{{season|}}}{{{months|}}}{{{sights|}}}{{{hazards|}}}{{{surface|}}}{{{ROW|}}}{{{website|}}}|Hiking details}} }}
 
| header21={{#if:{{{embed|}}}||{{#if:{{{difficulty|}}}{{{season|}}}{{{months|}}}{{{sights|}}}{{{hazards|}}}{{{surface|}}}{{{ROW|}}}{{{website|}}}|Hiking details}} }}
Line 54: Line 52:
 
| data24={{{months|}}}
 
| data24={{{months|}}}
 
| data25={{{waymark|}}}
 
| data25={{{waymark|}}}
| label25=Waymark
+
| label25=[[Waymark]]
 
| label26=Sights
 
| label26=Sights
 
| data26={{{sights|}}}
 
| data26={{{sights|}}}
| label30=Hazards
+
| label30=[[Hazards of outdoor recreation|Hazards]]
 
| data30={{{hazards|}}}
 
| data30={{{hazards|}}}
| label31=Surface
+
| label31=[[Road surface|Surface]]
 
| data31={{{surface|}}}
 
| data31={{{surface|}}}
| label32=Right of Way
+
| label32=[[Right-of-way_(transportation)|Right of way]]
 
| data32={{{ROW|}}}
 
| data32={{{ROW|}}}
 +
<!--
 
| label33=Maintained by
 
| label33=Maintained by
 
| data33={{{maintainer|}}}
 
| data33={{{maintainer|}}}
 +
-->
 
| label34=Website
 
| label34=Website
 
| data34={{{website|}}}
 
| data34={{{website|}}}
| label35=Direction of Travel
 
| data34={{{direction|}}}
 
 
| header35={{#if:{{{map|}}}|{{#if:{{{map_name|}}}|{{{map_name}}}|Trail map}} }}
 
| header35={{#if:{{{map|}}}|{{#if:{{{map_name|}}}|{{{map_name}}}|Trail map}} }}
 
| data36={{#if:{{{map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|size={{{map_size|}}}|sizedefault=264px|maxsize=296px|alt={{{map_alt|}}} }}|{{#if:{{{route|}}}|<table style="width: 100%;" class="mw-collapsible {{#switch:{{{route_state|}}}
 
| data36={{#if:{{{map|}}}|{{#invoke:InfoboxImage|InfoboxImage|image={{{map|}}}|size={{{map_size|}}}|sizedefault=264px|maxsize=296px|alt={{{map_alt|}}} }}|{{#if:{{{route|}}}|<table style="width: 100%;" class="mw-collapsible {{#switch:{{{route_state|}}}
Line 77: Line 75:
 
<tr><td style="text-align:center">
 
<tr><td style="text-align:center">
 
{{{route}}}
 
{{{route}}}
</td></tr></table>}} }}{{#if:{{{map|}}}{{{route|}}}|{{#if:{{{map_caption|}}}|<div style="text-align: center;">{{{map_caption}}}</div>}} }} }}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox hiking trail with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox hiking trail]] with unknown parameter "_VALUE_"|ignoreblank=y| began | caption | cellstyle | closed_date | completed | designation | difficulty | elev_change | elev_change_ft | elev_change_m | elev_gain_and_loss | embed | established | grade | hazards | highest | highest_ft | highest_m | highest_name | length | length_km | length_mi | location | lowest | lowest_ft | lowest_m | lowest_name | maintainer | map | map_alt | map_caption | map_name | map_size | months | name | photo | photo_alt | photo_size | route | route_state | ROW | season | sights | surface | title | trailheads | use | waymark | website | direction }}<noinclude>
+
</td></tr></table>}} }}
 +
| label37=Direction
 +
| data37={{{direction|}}}
 +
| label38=Trail agency
 +
| data38={{{trail_agency|}}}
 +
| label39=Abbreviated name
 +
| data39={{{abbreviated_name|}}}
 +
| label40=LongTrailsMap
 +
| data40={{{ltm_link|}}}
 +
| label41=OpenStreetMap
 +
| data41={{{osm_relation_link|}}}
 +
| label42=Wikidata
 +
| data42={{{wikidata_link|}}}
 +
{{#if:{{{map|}}}{{{route|}}}|{{#if:{{{map_caption|}}}|<div style="text-align: center;">{{{map_caption}}}</div>}} }} }}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox hiking trail with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox hiking trail]] with unknown parameter "_VALUE_"|ignoreblank=y| began | caption | cellstyle | closed_date | completed | designation | difficulty | elev_change | elev_change_ft | elev_change_m | elev_gain_and_loss | embed | established | grade | hazards | highest | highest_ft | highest_m | highest_name | length | length_km | length_mi | location | lowest | lowest_ft | lowest_m | lowest_name | <!-- maintainer | -->map | map_alt | map_caption | map_name | map_size | months | name | photo | photo_alt | photo_size | route | route_state | ROW | season | sights | surface | title | trailheads | use | waymark | website | direction | trail_agency | abbreviated_name | ltm_link | osm_relation_link | wikidata_link }}<noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Latest revision as of 23:34, 2 July 2021

Template documentation[view] [edit] [history] [purge]

This template is in articles about specific hiking trails. The example on the right shows a good example of how a trail template is properly used.

Blank template

{{{name}}}
[[File:{{{photo}}}|{{{photo_size}}}|alt={{{photo_alt}}}|{{{photo_alt}}}]]
{{{caption}}}
{{{title}}}
Length{{{length}}}
Location{{{location}}}
Established{{{established}}}
Began construction{{{began}}}
Completed{{{completed}}}
Closed{{{closed_date}}}
Designation{{{designation}}}
Trailheads{{{trailheads}}}
Elevation gain/loss{{{elev_gain_and_loss}}}
Elevation change{{{elev_change}}}
Highest point{{{highest_name}}}, [convert: invalid number], {{{highest}}}
Lowest point{{{lowest_name}}}, [convert: invalid number], {{{lowest}}}
Grade{{{grade}}}
Trail difficulty{{{difficulty}}}
Season{{{season}}}
Months{{{months}}}
Waymark{{{waymark}}}
Sights{{{sights}}}
Hazards{{{hazards}}}
Surface{{{surface}}}
Right of way{{{ROW}}}
Website{{{website}}}
{{{map_name}}}
[[File:{{{map}}}|{{{map_size}}}|alt={{{map_alt}}}|{{{map_alt}}}]]
Direction{{{direction}}}
Wikidata
{{{map_caption}}}
{{Infobox hiking trail
| name        = 
| embed       = 
| cellstyle   = 
| photo       = <!-- Bring in any photo from Wikimedia Commons, ie "photo = CowlitzDivide.JPG" for
                https://commons.wikimedia.org/wiki/File:CowlitzDivide.JPG -->
| photo_size  = 
| photo_alt   = 
| caption     = 
| title       = 
| established = 
| began       = 
| completed   = 
| closed_date = 
| length      = 
| location    = 
| designation = 
| trailheads  = 
| use         = Hiking
| elev_gain_and_loss =
| elev_change = <!-- Use elev_gain_and_loss if the gain and/or loss is known.
                     Use this field when only the change is known. -->
| highest     = 
| lowest      = 
| grade       = 
| difficulty  = 
| season      = 
| months      = 
| waymark     = 
| sights      = 
| hazards     = 
| surface     = 
| ROW         = 
| maintainer  = 
| website     = 
| map         = 
| map_name    = 
| map_caption = 
| map_size    = 
| map_alt     = 
| route       = 
| route_state = 
| direction   =
}}

Parameter descriptions

Parameter Description
name Name of the trail
length_km Length of the trail in kilometers, as a single number. Will convert to miles automatically
length_mi Length of the trail in miles, as a single number. Will convert to kilometers automatically. For information on use of units see Manual of Style Units.
length Length of trail, no auto-conversion. Use if you want to add more words or citation to length.
location Location of the trail including park, state, county or region where appropriate and country.
trailheads where trail begins and ends
use always include at least hiking
photo Photo of the area around the trail. Specify as filename.jpg, no need for "File:". Please use a high-resolution original (at least 300 pixels wide).
photo_size Width of displayed photo, in pixels. Defaults to 250.
photo_alt Alternate text for the displayed photo
designation Any designation which the trail has received e.g. UK National Trail or U.S. National Scenic Trail.
established Establishment date
elev_gain_and_loss The elevation gain and/or loss e.g. "{{convert|300|m|ft|-1}} gain" or "{{convert|300|m|ft|-1}} gain in; {{convert|100|m|ft|-1}} gain out". Please express the gain or loss in meters or feet, not kilometers or miles.
elev_change The sum of the altitude climbed or descended through the trail. Auto-converts units if _ft or _m suffix is used.
elev_change_ft
elev_change_m
highest_m Elevation of highest point on trail, in either meters or feet (will autoconvert). For information on the use of units see Manual of Style Units.
highest_ft
highest_name Name of highest point in trail (for use with highest_ft or highest_m)
highest Free field for highest point in trail, use when citations is needed
lowest_m Similar to highest_ etc., except describing the lowest point of the trail
lowest_ft
lowest_name
lowest
grade The grade in percent, typical with former railroad right-of-ways
difficulty The difficulty of the trail for a typical healthy person based on a reliable source
season The season(s) that the trail may be hiked, or is easily accessible
months The months that the trail may be hiked, or is easily accessible
sights Significant sights along the way
hazards Major hazards that a hiker may encounter, as documented by a reliable source
surface The trail surface: natural, gravel, ballast, asphalt, etc.
ROW The current or former Right of way, e.g. railroads or railways
maintainer The organisation responsible for maintaining the route
website Website of the organization that maintains the trail
waymark The waymark (sign or symbol) used to mark or signpost the route
map Map of the trail, if an image
map_name Map name. Default is "Trail map".
map_size Size of map (either in px or %)
map_alt Alt text for map
map_caption Caption for map
route Map of the trail, if a route diagram template
route_state Collapsed state of route map
direction Direction of travel
trail_agency Agency that stewards the trail (PCTA, ATC, CDTC, etc)

Embed inside another Infobox

The hiking trail Infobox can be embedded inside another Infobox for seamless display of info. For example, a hiking trail that is also a protected area, such as the Kal-Haven Trail. See the testcases for more examples.

Inserting the hiking Infobox inside the parent Infobox

The hiking Infobox can only be inserted after certain field values of the parent template. Specifically, only after fields whose values are not passed to another template by the parent templates source code. In other words, the parent templates source code for the field has to output the fields' value without passing it to a template. This may require examining the parent templates source code. It is ok to insert after field values that contain internal [[]] and external links [].
Example:

{| style="float:right; clear:right; border:0; margin:-0.5em 0 0 0;"
|-
|{{Infobox Protected area
| name = Kal-Haven Trail
...
| governing_body = <div>[[Michigan Department of Natural Resources]]</div>
{{Infobox hiking trail
  | embed = yes
  | cellstyle = padding:0.1em 0.3em;
  | name = Kal-Haven Trail
  | length = {{convert|34.5|mi|km|1}}
...
  }}
}}
|}

Note the <div> tag surrounding the governing_body wiki link. It is needed to reduce the vertical spacing between the governing_body field and the first hiking trail field, in this case, length.

Parent Infobox encapsulation

The parent Infobox needs to be encapsulated in a table as in the above example.

{| style="float:right; clear:right; border:0; margin:-0.5em 0 0 0;"
|-
|(parent Infobox)
|}

Parameters

Field name Description
embed Set to embed = yes when embedding inside another Infobox.
cellstyle Set to a class/style that matches the outer Infoboxes cell class/style so that the columns line up properly. Example for using with {{Infobox protected area}}:
cellstyle = padding:0.1em 0.3em;
title A first colored header before the main infobox, used when embedded, to show the trail name

Example

Wonderland Trail
CowlitzDivide.JPG
Mt Rainier from the Cowlitz Divide along the Wonderland Trail
Length93 miles (150 km)[1]
LocationMount Rainier National Park, Washington, United States
TrailheadsLongmire Lodge
Mowich Lake
Ipsut Creek Camp Ground
Sunrise parking area
White River Camp Ground
Fryingpan Creek Trailhead
Box Canyon
Reflection Lakes
Cougar Rock
Elevation
Elevation gain/loss22,000 feet (6,700 m) gain approximately[1]
Highest pointPanhandle Gap 6,750 feet (2,060 m)[2]
Lowest pointIpsut Creek Campground 2,320 feet (710 m)[1]
Hiking details
SeasonSummer to early Fall
MonthsMid-July through late September
Websitenps.gov/mora/planyourvisit/the-wonderland-trail.htm
{{Infobox hiking trail
 | name = Wonderland Trail
 | photo = CowlitzDivide.JPG
 | caption = Mt Rainier from the Cowlitz Divide along the Wonderland Trail
 | location = [[Mount Rainier National Park]], [[Washington (state)|Washington]], [[United States]]
 | length = {{convert|93|mi|km|0}}<ref name="Filley">
     {{cite book
     | author = Filley, Bette
     | year = 2002
     | title = Discovering the Wonders of the Wonderland Trail: Encircling Mount Rainier
     | publisher = Dunamis House
     | isbn = 1-880405-09-1
     | edition = 5th
     }}</ref>
 | trailheads = [[Longmire, Washington|Longmire Lodge]] <br/> [[Mowich Lake]] <br/> Ipsut Creek Camp Ground <br/> [[Sunrise (Mount Rainier)|Sunrise parking area]] <br/> White River Camp Ground <br/> Fryingpan Creek Trailhead <br/> Box Canyon <br/> Reflection Lakes <br/> Cougar Rock
 | use = [[Hiking]]
 | elev_gain_and_loss = {{convert|22000|ft|m|-2}} gain approximately<ref name="Filley"/>
 | highest = Panhandle Gap {{convert|6750|ft|m|-1}}<ref name="SpringManningMRNP">
     {{cite book
     | author = Spring, Ira
     | author-link = Ira Spring
     | author-link2 = Harvey Manning
     | author2=Manning, Harvey
     | year = 1999
     | title = 50 Hikes in Mount Rainier National Park
     | publisher = The Mountaineers
     | isbn = 0-89886-572-7
     }}</ref>
 | lowest = Ipsut Creek Campground {{convert|2320|ft|m|-1}}<ref name="Filley"/>
 | season = Summer to early [[Autumn|Fall]]
 | months = Mid-July through late September
 | website = [http://www.nps.gov/mora/planyourvisit/the-wonderland-trail.htm nps.gov/mora/planyourvisit/the-wonderland-trail.htm]
}}
  1. 1.0 1.1 1.2 Filley, Bette (2002). Discovering the Wonders of the Wonderland Trail: Encircling Mount Rainier (5th ed.). Dunamis House. ISBN 1-880405-09-1.
  2. Spring, Ira; Manning, Harvey (1999). 50 Hikes in Mount Rainier National Park. The Mountaineers. ISBN 0-89886-572-7.

Tracking category