From GamingWiki
Jump to: navigation, search
Line 1: Line 1:
<onlyinclude><!--
+
Display a timeline table for a campaign.
 +
 
 +
{{Documentation}}
 +
 
 +
<!--
 +
 
 +
--><onlyinclude><!--
 +
-->{{#vardefine: campaign    | {{{1| {{#show: {{PAGENAME}} | ?campaign#}} }}} }}<!--
 +
 
 +
--><noinclude>{{#vardefine: campaign | Steel Town }}</noinclude><!--
  
-->{{#vardefine:campaign|{{{campaign|{{{1<noinclude>|Steel Town</noinclude>}}}}}} }}<!--
 
 
   We can optionally specify different labels
 
   We can optionally specify different labels
-->{{#vardefine:booklabel|{{{booklabel|Book}}} }}<!--
+
-->{{#vardefine: booklabel   | {{{booklabel|Book}}} }}<!--
-->{{#vardefine:chapterlabel|{{{chapterlabel|Chapter}}} }}<!--
+
-->{{#vardefine: chapterlabel | {{{chapterlabel|Chapter}}} }}<!--
-->{{#vardefine: expandbook | {{{expandbook| {{#show: {{PAGENAME}} | ?book number | link=none | default=latest }} }}} }}<!--
+
 
-->{{#if:{{#var:expandbook}}||{{#vardefine:expandbook|latest}} }}<!--
+
-->{{#vardefine: expandbook   | {{{expandbook| {{#show: {{PAGENAME}} | ?book number# | default=latest }} }}} }}<!--
--><noinclude>{{#vardefine:expandbook|latest}}</noinclude><!--
+
 
 +
-->{{#ifeq:{{#var:expandbook|0}}|0|{{#vardefine:expandbook|latest}} }}<!--
  
 
   Use intro and outro templates so we can use this with SMW.
 
   Use intro and outro templates so we can use this with SMW.
Line 20: Line 29:
 
| format        = template
 
| format        = template
 
| template      = SMW campaign timeline
 
| template      = SMW campaign timeline
| userparam    = expandbook ; {{#var:expandbook}}
+
| userparam    = expandbook ; {{#var:expandbook|latest}}
 +
                , booklabel ; {{#var:booklabel}}
 +
                , chapterlabel ; {{#var:chapterlabel}}
 
}}<!--
 
}}<!--
  
 
-->{{#ifeq:{{#var:expandbook}}|latest|{{#if:{{#var:latestbook}}|<!--
 
-->{{#ifeq:{{#var:expandbook}}|latest|{{#if:{{#var:latestbook}}|<!--
 +
 
     Run a subquery on the last book's chapters
 
     Run a subquery on the last book's chapters
   -->{{#vardefineecho:innerqueryresult|{{#ask: [[chapter of campaign::{{#var:campaign}}]][[book number::{{#var:latestbook}}]]
+
   -->{{#vardefineecho:innerqueryresult|<!--
      |?title
+
      -->{{#ask: [[chapter of campaign::{{#var:campaign}}]][[book number::{{#var:latestbook}}]]
      |?ordinal
+
        |?title
      |?blurb
+
        |?ordinal
      |?label
+
        |?blurb
      | sort          = ordinal
+
        |?label
      | link          = none
+
        | sort          = ordinal
      | format        = template
+
        | link          = none
      | template      = SMW campaign chapter
+
        | format        = template
      }}}}<!--
+
        | template      = SMW campaign chapter
-->}}<!-- -->}}<!--
+
        }}<!--
 +
  -->}}<!--
 +
 
 +
-->}}<!-- end #if:{{#var:latestbook}}
 +
-->}}<!-- end #ifeq:{{#var:expandbook}}|latest
  
 
   Use intro and outro templates so we can use this with SMW.
 
   Use intro and outro templates so we can use this with SMW.
Line 41: Line 57:
  
 
--></onlyinclude>
 
--></onlyinclude>
 +
 +
[[Category: campaign templates]]

Revision as of 15:48, 11 April 2014

Display a timeline table for a campaign.

[edit] [purge]
Error creating thumbnail: File missing
Template documentation

Display a timeline table for a campaign.

The main argument to this template is the campaign name, and if that is omitted the "campaign" property of the current page will be used.

Here are the arguments available to this template (all optional):

parameter default description
campaign "campaign" property of the current page The name of the campaign to use.
booklabel Book The label to use for a major (top-level) story arc. An alternate label could be "season".
chapterlabel Chapter The label to use for a small story arc. An alternate label could be "episode".
expandbook latest By default, the latest book will be rendered with its chapters below it, and the other books without. By setting this to a book number you can change which book gets its chapters listed. Other legal values are "latest" "all" and "none".

The usual way of calling this template is simply:

  {{Campaign timeline}}

However, here is what this template looks like with parameters specified:

Campaign Timeline
?has title= ?has ordinal= ?has blurb= sort = ordinal link = none format = template template = SMW campaign timeline userparam = expandbook ; all
               , booklabel ;  
               , chapterlabel ; 

}}

  {{Campaign timeline
  | campaign     = Ghost Town
  | booklabel    = elephant
  | chapterlabel = strawberry
  | expandbook   = all
  }}

Campaign Timeline
?title= ?ordinal= ?blurb= ?label= sort = ordinal link = none format = template template = SMW campaign timeline ?book number# | default=latest }}
               , booklabel ; Book 
               , chapterlabel ; Chapter

}}