From GamingWiki
Jump to: navigation, search
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{Documentation}}
 
<!--
 
<!--
  
-->{{#vardefine: campaign | {{{campaign<noinclude>|Steel Town</noinclude>}}} }}<!--
+
--><onlyinclude><!--
 +
 
 +
  Process template parameters
 +
 
 +
  The campaign is either defined as campaign=foo or passed as the first parameter.
 +
  If it is omitted, we check that the current page is the campaign. This allows us
 +
  to conveniently call the template with no parameters while on the campaign page.
 +
-->{{#vardefine: campaign     | {{{campaign|{{{1| {{#show: {{PAGENAME}} | ?campaign#}} }}} }}} }}<!--
 +
--><noinclude>{{#vardefine: campaign | Humans are the Worst }}</noinclude><!--
 +
 
 +
  Should we expand volumes and books?
 +
-->{{#vardefine: expand    | {{{expand|all}}} }}<!--
 +
 
 +
-->{{#if:{{#var:campaign}}|<!--
 +
 
 +
  Other possible params include:
 +
  * volume : Only display books from the given volume (unsupported)
 +
  * book : Only display chapters from the given book
 +
  * chapter : Only display the given chapter
 +
 
 +
  @todo Collect params and pass them to Campaign_history/books. If book was specified this will
 +
  print out just that book. Otherwise it will look for any books and print them all out. If no
 +
  books are found it will simply print out all chapters for this campaign using the template
 +
  Campaign_history/chapters
 +
 
 +
-->{{#parameterstohash: paramHash}}<!--
 +
-->{{#hashinclude:      paramHash
 +
  | campaign = {{#var:campaign}}
 +
  }}<!--
 +
  | expand = {{#var:expand}}
 +
-->{{#hashtotemplate:  Campaign_history/books | paramHash }}<!--
 +
 
 +
 
 +
  @todo kill this?
 
   Find out if this is a book or a chapter:
 
   Find out if this is a book or a chapter:
 
-->{{#vardefine: parent |<!--
 
-->{{#vardefine: parent |<!--
 
     If it looks like we have the number of the parent book, query it.
 
     If it looks like we have the number of the parent book, query it.
 
   -->{{#if: {{{parentordinal|}}} |<!--
 
   -->{{#if: {{{parentordinal|}}} |<!--
       -->{{#ask: [[book of::{{#var: campaign}}]] [[book number::{{{parentordinal}}}]] | ?= |link=none}}<!--
+
       -->{{#ask: [[is book of::{{#var: campaign}}]] [[has book number::{{{parentordinal}}}]] |link=none|limit=1|searchlabel=}}<!--
 
   -->|<!--
 
   -->|<!--
 
         If there was no parent detected before, or if the previous query returned  
 
         If there was no parent detected before, or if the previous query returned  
Line 13: Line 47:
 
   -->}}<!--
 
   -->}}<!--
 
-->}}<!--
 
-->}}<!--
 +
 
-->{{#vardefine: title | {{{title|<includeonly>{{PAGENAME}}</includeonly><noinclude>Story title</noinclude>}}} }}<!--
 
-->{{#vardefine: title | {{{title|<includeonly>{{PAGENAME}}</includeonly><noinclude>Story title</noinclude>}}} }}<!--
  
 
   Timeline goes first
 
   Timeline goes first
-->{{Campaign timeline | {{#var:campaign}} }}<!--
+
--><!--{{#vardefine:timeline|{{Campaign timeline | {{#var:campaign}} }} }}--><!--
 +
--><!--{{#var:timeline}}--><!--
  
 
   Set SMW properties and category memberships
 
   Set SMW properties and category memberships
 +
 +
-->{{#vardefine: image | <!--
 +
  -->{{#if: {{{image|}}} | <!--
 +
      -->{{#ifexist: {{{image}}} | {{{image}}} <!--
 +
      -->| {{#ifexist: File:{{{image}}} | File:{{{image}}} }} <!--
 +
      -->}}<!--
 +
  -->}}<!--
 +
-->}}<!--
  
 
-->{{#vardefine: storytype | {{#if: {{#var:parent|}} | chapter | book }} }}<!--
 
-->{{#vardefine: storytype | {{#if: {{#var:parent|}} | chapter | book }} }}<!--
Line 26: Line 70:
 
   | {{#var:storytype}} of = {{#var:campaign}}
 
   | {{#var:storytype}} of = {{#var:campaign}}
 
   }}<!--
 
   }}<!--
-->[[Category: {{#var:campaign}}]]<!--
+
--><includeonly>[[Category: {{{category|{{#var:campaign}} stories}}}]]</includeonly><!--
 
-->{{#if: {{{ordinal|}}}      | {{#set: {{#var:storytype}} number = {{{ordinal}}} | ordinal = {{{ordinal}}} }} }}<!--
 
-->{{#if: {{{ordinal|}}}      | {{#set: {{#var:storytype}} number = {{{ordinal}}} | ordinal = {{{ordinal}}} }} }}<!--
-->{{#if: {{#var:parent}}        | {{#set: parent = {{#var:parent}} }} }}<!--
+
-->{{#if: {{#var:parent}}        | {{#set: has parent story = {{#var:parent}} | chapter in book = {{#var:parent}} }} }}<!--
 
-->{{#if: {{{parentordinal|}}} <!--
 
-->{{#if: {{{parentordinal|}}} <!--
 
   -->| {{#set: book number = {{{parentordinal}}} }} <!--
 
   -->| {{#set: book number = {{{parentordinal}}} }} <!--
 
   -->|<!--
 
   -->|<!--
       -->{{#if: {{#vardefineecho: booknumber | {{#ask: [[{{#var:parent|M_NUL}}]] |?ordinal= | link=none }} }}<!--
+
       -->{{#if: {{#vardefineecho: booknumber | {{#ask: [[{{#var:parent|M_NUL}}]] |?ordinal= | link=none |searchlabel= }} }}<!--
 
       -->| {{#set: book number = {{#var: booknumber}} }} }}<!--
 
       -->| {{#set: book number = {{#var: booknumber}} }} }}<!--
 
-->}}<!--
 
-->}}<!--
 
-->{{#if: {{{blurb|{{{content|}}}}}} |{{#set: blurb = {{{blurb|{{padright:|128|{{{content}}}}}...}}} }} }}<!--
 
-->{{#if: {{{blurb|{{{content|}}}}}} |{{#set: blurb = {{{blurb|{{padright:|128|{{{content}}}}}...}}} }} }}<!--
-->{{#if: {{{image|}}}              |{{#set: image = {{{image}}} }} }}<!--
+
-->{{#if:{{{content|}}}              |{{#set: content = {{{content}}} }} }}<!--
 +
-->{{#if: {{#var: image}}              |<!--
 +
  -->{{#set: image = {{#var: image}} }} <!--
 +
  -->{{#if: {{{caption|}}}          |{{#set: image caption = {{{caption}}} }} }}<!--
 +
-->}}<!--
 +
-->{{#if: {{{stars|}}} |<!--
 +
  -->{{#arraydefine:starlist|{{{stars}}}|;|sort=asc}}<!--
 +
  -->{{#arrayunique:starlist}}<!--
 +
  -->{{#arrayprint: starlist||$char$|{{#if:$char$|{{#set: starring = $char$ }} }} }}<!--
 +
-->}}<!--
 
-->{{#if: {{{cast|}}} |<!--
 
-->{{#if: {{{cast|}}} |<!--
   -->{{#arraydefine:castlist|{{{cast}}}|::|sort=asc}}<!--
+
   -->{{#arraydefine:castlist|{{{cast}}}|;|sort=asc}}<!--
   -->{{#arrayprint: castlist||$char$|{{#set: featuring = $char$ }} }}<!--
+
  -->{{#arrayunique:castlist}}<!--
 +
   -->{{#arrayprint: castlist||$char$|{{#set: guest-starring = $char$ }} }}<!--
 
-->}}<!--
 
-->}}<!--
 +
 +
  Sometimes we want a custom label such as "Act" or "Part";
 +
-->{{#if: {{{label|}}} | {{#set: label = {{{label}}} }} }}<!--
  
 
   Lay out page for display
 
   Lay out page for display
Line 46: Line 103:
 
--><h2>{{#var:title}}</h2><!--
 
--><h2>{{#var:title}}</h2><!--
  
-->{{#if: {{{location|}}}{{{timestamp|}}} | <!--
+
-->{{#vardefine: sessiondate | {{{date<includeonly>|</includeonly>}}} }}<!--
 +
 
 +
-->{{#if: {{{location|}}} |<!--
 +
  -->{{#arraydefine:locationlist|{{{location}}}|;|sort=asc}}<!--
 +
  -->{{#arrayunique:locationlist}}<!--
 +
  -->{{#arrayprint: locationlist||$loc$|{{#set: location = $loc$ }} }}<!--
 +
  -->{{#vardefine:location|{{#arrayprint:locationlist|, <nowiki />|@@@@|[[@@@@]]}}}}<!--
 +
-->}}<!--
 +
-->{{#if: {{#var:location}}{{{timestamp|}}}{{#var:sessiondate}} | <!--
 
   -->{{timestamp | <!--
 
   -->{{timestamp | <!--
       -->{{#if:{{{location|}}}| [[location::{{{location}}}]]{{#if:{{{timestamp|}}}|, }} }} <!--
+
       -->{{#if:{{#var:location}}| {{#var:location}}{{#if:{{{timestamp|}}}|, }} }} <!--
       -->{{#if:{{timestamp|}}}| [[timestamp::{{{timestamp}}}]] }} <!--
+
       -->{{#if:{{{timestamp|}}}| [[timestamp::{{{timestamp}}}]] }} <!--
 +
      -->{{#if:{{#var:sessiondate}}| ''(played [[session date::{{#var:sessiondate}}]])'' }} <!--
 
   -->}}<!--
 
   -->}}<!--
 
-->}}<!--
 
-->}}<!--
  
 
-->{{#if: {{{blurb|}}}              |<nowiki />
 
-->{{#if: {{{blurb|}}}              |<nowiki />
: ''{{{blurb}}}'' }}<!--
+
: ''{{{blurb}}}'' <nowiki />
-->{{#if:{{{image|}}}|[[Image:{{{image}}}|right|thumb|200px]]}}<!--
+
}}<!--
-->{{#if:{{{content|}}}              |{{#set: content = {{{content}}} }} <nowiki />
+
-->{{#if:{{#var: image}}             |[[{{#var:image}}|200px|thumb|right|{{{caption|}}}]]}}<!--
 +
-->{{#if:{{{content|}}}              |<nowiki />
 
{{{content}}} }}<!--
 
{{{content}}} }}<!--
  
 
== Chapters ==
 
== Chapters ==
  
-->{{#ask: [[story of::{{#var:campaign}}]] [[parent::{{PAGENAME}}||{{#var:title}}]]
+
--><nowiki />
 +
{{#ask: [[chapter in book::{{PAGENAME}}||{{#var:title}}]]
 
|?title
 
|?title
|?ordinal
+
|?chapter number
 
|?blurb
 
|?blurb
| sort          = ordinal
+
|?empty
 +
|?label
 +
|?image
 +
|?parentordinal
 +
| sort          = chapter number
 
| link          = none  
 
| link          = none  
 
| format        = template
 
| format        = template
| template      = SMW campaign chapters level 2
+
| template      = SMW campaign chapters level 3
 
}}<!--
 
}}<!--
  
-->
+
-->|<!-- else !var:campaign
 +
 
 +
  -->{{Error|No campaign specified for template "Campaign history"}}<!--
 +
 
 +
-->}}<!-- end if var:campaign
 +
--></onlyinclude>

Latest revision as of 14:36, 18 October 2014

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

Given a campaign name, print out a summary of the whole campaign history.

Usage[edit]

{{Campaign history | Humans are the Worst}}

Parameters[edit]

campaign[edit]

Specify the campaign to query. May be specified with the parameter name or as the first parameter, so the following are equivalent:

{{Campaign history | Humans are the Worst}}
{{Campaign history | campaign=Humans are the Worst}}

This parameter may be omitted when used on a campaign page, and will use Campaign history as the campaign name.

expand[edit]

Should volumes and books be expanded to show their contents? Valid values are:

  • all (default): expand everything, showing all chapters
  • book: expand to the level of books. The blurb and other details for each book are displayed, as well as links to each chapter. However, chapter details are hidden.
  • volume: expand to the level of volumes. The blurb and other details for each volume are displayed, as well as links to each book and to each chapter. However, book and chapter details are hidden.
  • none: Don't expand anything. Only list volume, book and chapter titles with no blurbs or other information.

Book {{{book number}}}

Book {{{book number}}}, [[{{{page}}}|Chapter {{{chapter number}}}]]

Book {{{book number}}}, [[{{{page}}}|Chapter {{{chapter number}}}]]


Book {{{book number}}}

Book {{{book number}}}, [[{{{page}}}|Chapter {{{chapter number}}}]]

Book {{{book number}}}, [[{{{page}}}|Chapter {{{chapter number}}}]]

{{#set:

  | title  = Story title
  | is a   = book
  | book of = Humans are the Worst

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

Story title

(played [[session date::{{{date}}}]])

{{#ask: |Story title |?title |?chapter number |?blurb |?empty |?label |?image |?parentordinal | sort = chapter number | link = none | format = template | template = SMW campaign chapters level 3 }}