Template:Park trail miles: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
(line return getting added)
(add trail stubs inclusion)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>This returns the total mileage of trails assigned to the park page that this template is called on. '''Note:''' The template also returns the unit 'miles'.
<noinclude>This returns the total mileage of trails assigned to the park page that this template is called on. '''Note:''' The template also returns the unit 'miles'.


More specifically, for pages with [[:Category:Trail]] and the property [[Property:Park|Park]] set to the page name, it sums the values in property [[Property:Trail distance round trip|Trail distance round trip]] in miles and returns that value. Trail distances need to be cleaned up and likely offer a pure "trail length" separate from "typical hike distance."
More specifically, for pages with [[:Category:Trails]] and the property [[Property:Park|Park]] set to the page name, it sums the values in property [[Property:Trail Distance|Trail Distance]] in miles and returns that value.


It should be called in the following format:
It should be called in the following format. Typically expected for current page but can be changed as needed:
<pre>
<pre>
{{Park trail miles}}
{{Park trail miles|Park={{PAGENAME}}}}
</pre>
</pre>
Edit the page to see the template text.
Edit the page to see the template text.
Example output for Warriors' Path State Park:
{{#number_format:{{#ask: [[Category:Trail||Trails||Trail Stubs]] [[Park::Warriors' Path State Park]]
  | ?Trail Distance#mi
  | format=sum
}}
|2
}} miles
[[Category:Park Class Items]]
</noinclude>
</noinclude>
<includeonly>{{#number_format:{{#ask: [[Category:Trail]] [[Park::{{PAGENAME}}]]
<includeonly>{{#number_format:{{#ask: [[Category:Trail||Trails||Trail Stubs]] [[Park::{{#if: {{{Park|}}}|{{{Park|}}}|{{PAGENAME}} }}]]
   | ?Trail Distance#mi
   | ?Trail Distance#mi
   | format=sum
   | format=sum

Latest revision as of 10:50, 12 December 2018

This returns the total mileage of trails assigned to the park page that this template is called on. Note: The template also returns the unit 'miles'.

More specifically, for pages with Category:Trails and the property Park set to the page name, it sums the values in property Trail Distance in miles and returns that value.

It should be called in the following format. Typically expected for current page but can be changed as needed:

{{Park trail miles|Park={{PAGENAME}}}}

Edit the page to see the template text.

Example output for Warriors' Path State Park: 17.84 miles