Template:Park trail miles: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
(Undo revision 7410 by Tim (talk) - didn't work out)
Tag: Undo
m (add template category)
Line 8: Line 8:
</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]] [[Park::Warriors' Path State Park]]
  | ?Trail Distance#mi
  | format=sum
}}
|2
}} miles
[[Category:Park Class Items]]
</noinclude>
</noinclude>
<includeonly>{{#number_format:{{#ask: [[Category:Trail||Trails]] [[Park::{{#if: {{{Park|}}}|{{{Park|}}}|{{PAGENAME}} }}]]
<includeonly>{{#number_format:{{#ask: [[Category:Trail||Trails]] [[Park::{{#if: {{{Park|}}}|{{{Park|}}}|{{PAGENAME}} }}]]

Revision as of 10:28, 20 November 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