From GamingWiki
Jump to: navigation, search
(Created page with "{| class="infobox floatright {{{cssclass|}}}" ! colspan="2" | [[{{{campaign}}}]]<br /><small>Campaign Timeline</small> <!-- -->{{#vardefine:booklabel|{{{booklabel|Book}}}}}<!-- -...")
 
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="infobox floatright {{{cssclass|}}}"
+
{{Documentation}}
! colspan="2" | [[{{{campaign}}}]]<br /><small>Campaign Timeline</small> <!--
+
<!--
-->{{#vardefine:booklabel|{{{booklabel|Book}}}}}<!--
+
 
-->{{#hashdefine:booktitles}}<!--
+
--><includeonly><onlyinclude><!--
-->{{#vardefine:chapterlabel|{{{chapterlabel|Chapter}}}}}<!--
+
-->{{#vardefine: campaign    | {{{campaign|{{{1| {{#show: {{PAGENAME}} | ?campaign#}} }}} }}} }}<!--
-->{{#hashdefine:bookchapters}}<!--
+
 
-->{{#hashdefine:chapterhash}}<!--
+
-->{{#vardefine: expandbook  | {{{expandbook| {{#show: {{PAGENAME}} | ?book number# | default=latest }} }}} }}<!--
-->{{#vardefine: content |{{{content|{{{1|}}} }}} }}<!--
+
 
 +
-->{{#ifeq:{{#var:expandbook|}}||{{#vardefine:expandbook|latest}} }}<!--
  
-->{{#forargs: book | booknum | bookname |<!--
+
  Use intro and outro templates so we can use this with SMW.
  -->{{#hashreset:chapterhash}}<!--
+
-->{{#vardefineecho:intro|{{Campaign timeline intro | cssclass={{{cssclass|}}} | campaign={{#var:campaign}} }} }}<!--
  -->{{#forargs: chapter {{#var:booknum}}. | chapnum | chapname |<!--
+
-->{{#ask: [[book of campaign::{{#var:campaign}}]]
      -->{{#hashinclude: chapterhash | {{#var:chapnum}} | {{#var: chapname}} }}<!--
+
|?has title=
  -->}}<!-- end forargs
+
|?has ordinal=
-->}}<!-- end forargs
+
|?has blurb=
-->{{#vardefine:booknum|0}}<!--
+
| sort          = ordinal
-->{{#vardefine:rownum|0}}<!--
+
| link          = none
-->{{#while: | <!--
+
| format        = template
  -->{{#vardefineecho: booktitle|{{{book {{#vardefineecho: booknum| {{#expr:{{#var:booknum}}+1}} }}|}}} }}<!--
+
| template      = SMW campaign timeline
-->|<!--
+
| userparam    = expandbook ; {{#var:expandbook|latest}}
   -->{{#vardefine: rownum| {{#expr:{{#var:rownum}}+1}} }}<!--
+
                , booklabel ; {{#var:booklabel}}  
  --><nowiki />
+
                , chapterlabel ; {{#var:chapterlabel}}
{{!}}-
+
}}<!--
{{!}} colspan="2" class="subhead" {{!}} {{#var:booklabel}} {{#var: booknum}}: {{#var: booktitle}}<!--
+
 
  -->{{#vardefine:chapnum|1}}<!--
+
-->{{#ifeq:{{#var:expandbook}}|latest|{{#if:{{#var:latestbook}}|<!--
   -->{{#while: | {{{b{{#var:booknum}}chapter{{#var: chapnum}}|}}} <!--
+
 
  -->|<!--
+
    Run a subquery on the last book's chapters
      -->{{#vardefine: rownum| {{#expr:{{#var:rownum}}+1}} }}<!--
+
   -->{{#vardefineecho:innerqueryresult|<!--
      --><nowiki />
+
      -->{{#ask: [[chapter of campaign::{{#var:campaign}}]][[book number::{{#var:latestbook}}]]
{{!}}-
+
        |?title
{{!}} class="label" {{!}} {{#var:chapterlabel}} {{#var:chapnum}}  
+
        |?ordinal
{{!}} {{{b{{#var:booknum}}chapter{{#var: chapnum}} |}}}
+
        |?blurb
<!--
+
        | sort          = ordinal
      -->{{#vardefine: chapnum| {{#expr:{{#var:chapnum}}+1}} }}<!--
+
        | link          = none
  -->}}<!-- end while chapter
+
        | format        = template
-->}}<!-- end while book
+
        | 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.
 +
-->{{Campaign timeline outro | colspan={{#var:cols}} | template name={{{template name|Campaign timeline}}} }}<!--
 +
 
 +
--></onlyinclude></includeonly>
 +
 
 +
[[Category: campaign templates]]

Latest revision as of 16:33, 5 October 2014

[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
  }}