Template:Park trail table template: Difference between revisions

From TEHCC Wiki
Jump to navigation Jump to search
m (add tooltip quotes)
m (unnecessary tweak to remove trailing slash)
 
(9 intermediate revisions by the same user not shown)
Line 2: Line 2:


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.  
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.  
NOTE: This template will strip anything past "(", the open parenthesis. This is to clean up links to trails to remove any parenthetical disambiguation. For example, [[Ridge Top (Roan Mountain State Park)]] will be shown as [[Ridge Top (Roan Mountain State Park)|Ridge Top]].
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 [[Form:Trail|Trail Form]] with fields prepopulated based on the trail stub information.


<p>It expects the following usage format.
<p>It expects the following usage format.
Line 12: Line 16:
  |difficulty=
  |difficulty=
  |marking=
  |marking=
|highlight=
|use=
|park=
}}
}}
</pre>
</pre>
But its usage in practice is like this with the middle two calls of the header and actual query being repeated as necessary
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.
<pre>
<pre>
ADD LATER
{{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 Highlight=highlight
| ?Trail Use=use
|format=plainlist
|headers=hide
|link=none
|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
| ?Trail Highlight=highlight
| ?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}}
</pre>
</pre>
Edit the page to see the template text.
Edit the page to see the template text.
Line 26: Line 63:
! Difficulty
! Difficulty
! Marking
! Marking
! Usage
! Highlight
{{!}}-
{{!}}-
|outro={{!}}}
|outro={{!}}}
|row={{!}}-
|row={{!}}-
{{!}}{{{trail|}}}
{{!}}[[{{{trail|}}}{{!}}{{#explode:{{{trail|}}}|<nowiki/> (<nowiki/>|0}}]]
{{!}}{{{distance|}}}
{{!}}{{{distance|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{marking|}}}
{{!}}{{{marking|}}}
{{!}}{{Auto List to Icons|List={{{use|}}}}}
{{!}}{{{highlight|}}}
{{!}}-
{{!}}-
|stubs row={{!}}-
|stubs row={{!}}-
{{!}}{{#ifexist: {{{trail|}}} | [[{{{trail|}}}]]{{#info: This trail name already exists as a page on this wiki. Either the page was created after making this "stub" or a name collision has occurred. Delete the trail stub from this park or make the trail stub name on this park unique. | error }} | {{#formredlink:target={{{trail|}}}|form=Trail|tooltip="Trail Stub tooltip"|query string=Trail[Park]={{PAGENAME}}&Trail[Trail Marking]={{{marking|}}}&Trail[Trail Distance]={{{distance|}}}&Trail[Difficulty Rating]={{{difficulty|}}} }}{{#info: This trail is a "stub" either because of its short length, lack of significance, or the page hasn't been created yet. The page can be created, but then delete the stub reference from this park. | info }} }}
{{!}}{{#ifexist: {{{trail|}}} | [[{{{trail|}}}]]{{#info: This trail name already exists as a page on this wiki. Either the page was created after making this "stub" or a name collision has occurred. Delete the trail stub from this park or make the trail stub name on this park unique. | error }} | {{#formredlink:target={{{trail|}}}|form=Trail|query string=Trail[Park]={{{park|}}}&Trail[Trail Marking]={{{marking|}}}&Trail[Trail Distance]={{{distance|}}}&Trail[Trail Highlight]={{{highlight|}}}&Trail[Difficulty Rating]={{{difficulty|}}} }}{{#info: This trail is a "stub" either because of its short length, lack of significance, or the page hasn't been created yet. The page can be created, but then delete the stub reference from this park. | info }} }}
{{!}}{{{distance|}}}
{{!}}{{{distance|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{difficulty|}}}
{{!}}{{{marking|}}}
{{!}}{{{marking|}}}
{{!}}<nowiki> </nowiki>
{{!}}{{{highlight|}}}
{{!}}-
{{!}}-
|header={{!}}-
|header={{!}}-
!colspan="4"{{!}}{{{header|}}}
!colspan="6"{{!}}{{{header|}}}
{{!}}-
{{!}}-
}}</includeonly>
}}</includeonly>

Latest revision as of 12:47, 28 December 2019

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.

NOTE: This template will strip anything past "(", the open parenthesis. This is to clean up links to trails to remove any parenthetical disambiguation. For example, Ridge Top (Roan Mountain State Park) will be shown as Ridge Top.

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=
 |highlight=
 |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 Highlight=highlight
 | ?Trail Use=use
 |format=plainlist
 |headers=hide
 |link=none
 |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
 | ?Trail Highlight=highlight
 | ?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.