From GamingWiki
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
<onlyinclude><!--
+
{{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|limit=1}}<!--
+
       -->{{#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 18: Line 51:
  
 
   Timeline goes first
 
   Timeline goes first
-->{{#vardefine:timeline|{{Campaign timeline | {{#var:campaign}} }} }}<!--
+
--><!--{{#vardefine:timeline|{{Campaign timeline | {{#var:campaign}} }} }}--><!--
-->{{#var:timeline}}<!--
+
--><!--{{#var:timeline}}--><!--
  
 
   Set SMW properties and category memberships
 
   Set SMW properties and category memberships
Line 37: Line 70:
 
   | {{#var:storytype}} of = {{#var:campaign}}
 
   | {{#var:storytype}} of = {{#var:campaign}}
 
   }}<!--
 
   }}<!--
-->[[Category: {{{category|{{#var:campaign}} stories}}}]]<!--
+
--><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}} | chapter in book = {{#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}} }} }}<!--
 
-->}}<!--
 
-->}}<!--
Line 110: Line 143:
 
}}<!--
 
}}<!--
  
 +
-->|<!-- else !var:campaign
 +
 +
  -->{{Error|No campaign specified for template "Campaign history"}}<!--
 +
 +
-->}}<!-- end if var:campaign
 
--></onlyinclude>
 
--></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 }}