Template:Park trail count: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
(change to pass page to park templates)
(forgot to include the example)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
<noinclude>This returns the number of trails assigned to the park that this template is called on.  
<noinclude>This returns the number of trails assigned to the park that this template is called on.  


More specifically it counts the number of pages with [[:Category:Trail]] and the property [[Property:Park|Park]] set to the page name this template is called on.
More specifically it counts the number of pages with [[:Category:Trails]] and the property [[Property:Park|Park]] set to the page name this template is called on.


It should be called in the following format, typically expected to reference current page but can be used as needed:
It should be called in the following format, typically expected to reference current page but can be used as needed:
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:
{{#ask: [[Category:Trail||Trails||Trail Stubs]] [[Park::Warriors' Path State Park]]
| format=count
}}
[[Category:Park Class Items]]
</noinclude>
</noinclude>
<includeonly>{{#ask: [[Category:Trail]] [[Park::{{{Park}}}]]
<includeonly>{{#ask: [[Category:Trail||Trails||Trail Stubs]] [[Park::{{#if: {{{Park|}}}|{{{Park|}}}|{{PAGENAME}} }}]]
  | format=count
  | format=count
}}</includeonly>
}}</includeonly>

Latest revision as of 11:50, 12 December 2018

This returns the number of trails assigned to the park that this template is called on.

More specifically it counts the number of pages with Category:Trails and the property Park set to the page name this template is called on.

It should be called in the following format, typically expected to reference current page but can be used as needed:

{{Park trail count|Park={{PAGENAME}}}}

Edit the page to see the template text.

Example output for Warriors' Path State Park: 24