Template:Park trail table template: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
m (template details and use passed park parameter for park of trail stub form link)
(make 4th usage column)
Line 14: Line 14:
  |difficulty=
  |difficulty=
  |marking=
  |marking=
|use=
  |park=
  |park=
}}
}}
Line 25: Line 26:
  | ?Difficulty=difficulty
  | ?Difficulty=difficulty
  | ?Trail Marking=marking
  | ?Trail Marking=marking
| ?Trail Use=use
  |format=plainlist
  |format=plainlist
  |headers=hide
  |headers=hide
Line 55: Line 57:
! Difficulty
! Difficulty
! Marking
! Marking
! Usage
{{!}}-
{{!}}-
|outro={{!}}}
|outro={{!}}}
Line 62: Line 65:
{{!}}{{{difficulty|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{marking|}}}
{{!}}{{{marking|}}}
{{!}}{{Auto List to Icons|List={{{use|}}}}}
{{!}}-
{{!}}-
|stubs row={{!}}-
|stubs row={{!}}-
Line 68: Line 72:
{{!}}{{{difficulty|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{marking|}}}
{{!}}{{{marking|}}}
{{!}}<nowiki> </nowiki>
{{!}}-
{{!}}-
|header={{!}}-
|header={{!}}-
!colspan="4"{{!}}{{{header|}}}
!colspan="5"{{!}}{{{header|}}}
{{!}}-
{{!}}-
}}</includeonly>
}}</includeonly>

Revision as of 18:35, 15 December 2018

This is a format template for the Template:Park trail table. It is expected to be used in conjunction with a semantic query. The parameter userparam is part of the format 'template' and is used to specify the switch to 'row' when needed. Otherwise repeated calls can use the template to envoke the intro, outro, or a header output. If using the header output, you can specify the additional 'header' parameter to give it the text to place in the header row.

This template was created to handle the combination of trail pages and trail stubs (park page subobjects). As of now, this seems to be the only way to seamlessly accomplish that in a pleasing format.

Trail stubs are checked for pages already created with that name. If it is and info-error box is shown explaining the problem. Trail stubs that don't have a page already created (or name collision with an existing page) are given a red link to the Trail Form with fields prepopulated based on the trail stub information.

It expects the following usage format.

{{Park trail table template
 |#userparam=
 |header=
 |trail=
 |distance=
 |difficulty=
 |marking=
 |use=
 |park=
}}

But its usage in practice is like this with the middle two calls being used to get the trails specified as pages and the second to get Trail Stubs created on the park page.

{{Park trail table template|#userparam=intro}}
{{#ask:[[Category:Trail||Trails]] [[Park::Warriors' Path State Park]]
 |mainlabel=trail
 | ?Trail Distance#mi-p2=distance
 | ?Difficulty=difficulty
 | ?Trail Marking=marking
 | ?Trail Use=use
 |format=plainlist
 |headers=hide
 |template=Park trail table template
 |userparam=row
 |named args=yes
}}
{{#ask: [[Category:Trail Stubs]] [[-Has subobject::Warriors' Path State Park]]
 | mainlabel=-
 | ?Trail=trail
 | ?Trail Distance#mi-p2=distance
 | ?Difficulty=difficulty
 | ?Trail Marking=marking
 | ?Park=park
 |format=plainlist
 |headers=hide
 |link=none
 |template=Park trail table template
 |userparam=stubs row
 |named args=yes
}}
{{Park trail table template|#userparam=outro}}

Edit the page to see the template text.