From GamingWiki
Jump to: navigation, search
Line 1: Line 1:
{{Campaign timeline | {{{campaign|}}} }}<!--
+
<!--
  
-->{{#parameterstohash: paramsHash}}<!--
+
-->{{#vardefine: campaign | {{{campaign<noinclude>|Steel Town</noinclude>}}} }}<!--
 +
  Find out if this is a book or a chapter:
 +
-->{{#vardefine: parent |<!--
 +
    If it looks like we have the number of the parent book, query it.
 +
  -->{{#if: {{{parentordinal|}}} |<!--
 +
      -->{{#ask: [[book of::{{#var: campaign}}]] [[book number::{{{parentordinal}}}]] | ?= |link=none}}<!--
 +
  -->|<!--
 +
        If there was no parent detected before, or if the previous query returned
 +
        no results, assume the parameter is a page name:
 +
      -->{{{parent|}}}<!--
 +
  -->}}<!--
 +
-->}}<!--
 +
-->{{#vardefine: title | {{{title|<includeonly>{{PAGENAME}}</includeonly><noinclude>Story title</noinclude>}}} }}<!--
 +
 
 +
  Timeline goes first
 +
-->{{Campaign timeline | {{#var:campaign}} }}<!--
  
Pass this off to another template. First find out if this is a book or a chapter:
+
  Set SMW properties and category memberships
  
-->{{#if:<!--
+
-->{{#vardefine: storytype | {{#if: {{#var:parent|}} | chapter | book }} }}<!--
  -->{{#vardefineecho: parent |<!--
+
-->{{#set:
        If it looks like we have the number of the parent book, query it.
+
  | title  = {{#var:title}}
      -->{{#if: {{{parentordinal|}}} |<!--
+
  | is a  = {{#var:storytype}}
        -->{{#ask: [[book of::{{{campaign|M_NUL}}}]] [[book number::{{{parentordinal}}}]] | ?= |link=none}}<!--
+
  | {{#var:storytype}} of = {{#var:campaign}}
       -->|<!--
+
  }}<!--
          If there was no parent detected before, or if the previous query returned
+
-->[[Category: {{#var:campaign}}]]<!--
          no results, assume the parameter is a page name:
+
-->{{#if: {{{ordinal|}}}       | {{#set: {{#var:storytype}} number = {{{ordinal}}} | ordinal = {{{ordinal}}} }} }}<!--
        -->{{{parent|}}}<!--
+
-->{{#if: {{#var:parent}}        | {{#set: parent = {{#var:parent}} }} }}<!--
       -->}}<!--
+
-->{{#if: {{{parentordinal|}}} <!--
 +
  -->| {{#set: book number = {{{parentordinal}}} }} <!--
 +
  -->|<!--
 +
      -->{{#if: {{#vardefineecho: booknumber | {{#ask: [[{{#var:parent|M_NUL}}]] |?ordinal= | link=none }} }}<!--
 +
       -->| {{#set: book number = {{#var: booknumber}} }} }}<!--
 +
-->}}<!--
 +
-->{{#if: {{{blurb|{{{content|}}}}}} |{{#set: blurb = {{{blurb|{{padright:|128|{{{content}}}}}...}}} }} }}<!--
 +
-->{{#if: {{{image|}}}              |{{#set: image = {{{image}}} }} }}<!--
 +
-->{{#if: {{{cast|}}} |<!--
 +
  -->{{#arraydefine:castlist|{{{cast}}}|::|sort=asc}}<!--
 +
  -->{{#arrayprint: castlist||$char$|{{#set: featuring = $char$ }} }}<!--
 +
-->}}<!--
 +
 
 +
  Lay out page for display
 +
 
 +
--><h2>{{#var:title}}</h2><!--
 +
 
 +
-->{{#if: {{{location|}}}{{{timestamp|}}} | <!--
 +
  -->{{timestamp | <!--
 +
      -->{{#if:{{{location|}}}| [[location::{{{location}}}]]{{#if:{{{timestamp|}}}|, }} }} <!--
 +
       -->{{#if:{{timestamp|}}}| [[timestamp::{{{timestamp}}}]] }} <!--
 
   -->}}<!--
 
   -->}}<!--
-->|{{#hashinclude: paramsHash | parent = {{#var:parent}} }}<!--
 
-->|{{#hashinclude: paramsHash | touch  = touch }}<!--
 
 
-->}}<!--
 
-->}}<!--
  
-->{{#hashtotemplate: <!--
+
-->{{#if: {{{blurb|}}}              |<nowiki />
  --><!--{{#if: {{#var:parent}} | Campaign chapter | Campaign book }} --><!--
+
: ''{{{blurb}}}'' }}<!--
  --> Campaign story <!--
+
-->{{#if:{{{image|}}}|[[Image:{{{image}}}|right|thumb|200px]]}}<!--
  -->| paramsHash }}<!--
+
-->{{#if:{{{content|}}}              |{{#set: content = {{{content}}} }} <nowiki />
 +
{{{content}}} }}<!--
 +
 
 +
== Chapters ==
 +
 
 +
-->{{#ask: [[story of::{{#var:campaign}}]] [[parent::{{PAGENAME}}||{{#var:title}}]]
 +
|?title
 +
|?ordinal
 +
|?blurb
 +
| sort          = ordinal
 +
| link          = none
 +
| format        = template
 +
| template      = SMW campaign chapters level 2
 +
}}<!--
 +
 
 
-->
 
-->

Revision as of 16:44, 25 April 2011

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

}}

{{#set:

  | title  = Story title
  | is a   = book
  | book of = Steel Town

}}{{#set: book number = {{#ask: M_NUL |?ordinal= | link=none }} }}

Story title

{{#ask: story of::Steel Town |Story title

|?title |?ordinal |?blurb | sort = ordinal | link = none | format = template | template = SMW campaign chapters level 2 }}