Template:Trip Report Table Format: Difference between revisions
m (fix missing bang) |
(add 200 char limit) |
||
(50 intermediate revisions by the same user not shown) | |||
Line 44: | Line 44: | ||
Edit the page to see the template text. | Edit the page to see the template text. | ||
[[Category:Universal Templates]] | [[Category:Universal Templates]] | ||
</noinclude><includeonly>{{#switch:{{{#userparam|}}} | </noinclude><includeonly>{{#if: {{{Trail|}}}|{{#arraydefine:parkname|{{#ask:[[{{#explode:{{{Trail|}}}|,|0}}]] | ||
|?Park | |||
|headers=hide | |||
|mainlabel=- | |||
}}}}}}{{#switch:{{{#userparam|}}} | |||
|intro={{{!}} border="1" class="wikitable" | |intro={{{!}} border="1" class="wikitable" | ||
! Date | ! Date | ||
! Trail(s) | ! style="width: 175px" {{!}} Trail(s) | ||
! Hike Distance | ! Hike Distance | ||
! # of Hikers | ! # of Hikers | ||
! Tags | ! Tags | ||
! Reported By | ! Reported By | ||
{{!}}- | {{!}}- | ||
|outro={{!}}} | |outro={{!}}} | ||
|row={{!}}- | |row=<br/> | ||
{{# | {{!}}-{{#ifeq:{{{TEHCC Organized Event|}}}|Yes| style="background: LightGreen; font-weight:bold"}} | ||
{{!}}{{{Trail|}}} | {{!}}rowspan="2" style="white-space: nowrap;"{{!}} [[{{{Report Page|}}}{{!}}{{{Trip Date|}}}]] | ||
{{!}}{{#arraymap:{{{Trail|}}}|,|@@@@|[[@@@@]]}}{{#if: {{#arrayprint:parkname}}|<br/><small>{{#arrayprint:parkname}}</small>}} | |||
{{!}}{{{Trail distance round trip|}}} | {{!}}{{{Trail distance round trip|}}} | ||
{{!}}{{{How Many Hiked|}}} | {{!}}{{{How Many Hiked|}}} | ||
{{!}}{{{Report Tags|}}} | {{!}}{{{Report Tags|}}} | ||
{{!}}{{{Reported By|}}} | {{!}}[[{{{Reported By|}}}|{{#explode:{{{Reported By|}}}|:|1}}]] | ||
{{!}}- | {{!}}-{{#ifeq:{{{TEHCC Organized Event|}}}|Yes| style="background: LightGreen; font-weight:bold"}} | ||
{{!}}colspan="5"{{!}}'''Comment:''' {{#sub:{{{Hike Comment|}}}|0|200}}{{#ifexpr: {{#len:{{{Hike Comment|}}}}} > 200 | [[{{{Report Page|}}}{{!}}...more]] }} | |||
|header={{!}}- | |header={{!}}- | ||
!colspan="7"{{!}}{{{header|}}} | !colspan="7"{{!}}{{{header|}}} | ||
{{!}}- | {{!}}- | ||
}}</includeonly> | }}</includeonly> |
Latest revision as of 14:53, 25 September 2020
This is a format template for Category:Trip Reports. 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 which part of the table is needed to be generated. Repeated calls can use the template to invoke the intro, outro, header, as well as individual row output. If using the header output, you can specify the additional 'header' parameter to give it the text to place in the header row.
It expects the following usage format. Header is only used when #userparam is set to header. Remaining fields are used when #userparam is set to row.
{{Trip Report Table Format |#userparam= |header= |Report Page= |Trip Date= |Trail= |Trail distance round trip= |How Many Hiked= |Hike Comment= |Report Tags= |Reported By= }}
But its usage in practice is like this with the middle two calls of the header and actual query being repeated as necessary
{{Trip Report Table Format|#userparam=intro}} {{Trip Report Table Format|#userparam=header|header=Hikes for October 2019}} {{#ask: [[Category:Trip Reports]] [[Trip Date::>>{{#time: 1 F Y | -2 month}}]] [[Trip Date::<{{#time: t F Y | -2 month}}]] |?Trip Date |?Trail |?Trail distance round trip |?How Many Hiked |?Hike Comment |?Report Tags |?Reported By |?TEHCC Organized Event |format=plainlist |headers=hide |link=none |sort=Trip Date |order=asc |mainlabel=Report Page |template=Trip Report Table Format |userparam=row |named args=yes }} {{Trip Report Table Format|#userparam=outro}}
Edit the page to see the template text.