Difference between revisions of "Template:Infobox Story/adventure"

From Twinsuniverse
Jump to: navigation, search
(Created page with "<includeonly>{{ #vardefine: lba1 | {{#ifeq: {{lc: {{#if:{{{lba1|}}}|{{{lba1}}}|no}}}} | no | | {{categorizer|display=infobox|nocat={{{nocat|false}}} |category=LBA1...")
 
m (indentation)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>{{
 
<includeonly>{{
#vardefine: lba1 | {{#ifeq: {{lc: {{#if:{{{lba1|}}}|{{{lba1}}}|no}}}} | no |
+
#vardefine: lba | {{#var:lba|}}{{#ifeq: {{lc:{{#if:{{{lba1|}}}|{{{lba1}}}|no}}}} | no || 1 }}}}{{
    | {{categorizer|display=infobox|nocat={{{nocat|false}}}
+
#vardefine: lba | {{#var:lba|}}{{#ifeq: {{lc:{{#if:{{{lba2|}}}|{{{lba2}}}|no}}}} | no || 2 }}}}{{
        |category=LBA1 stories
+
#vardefine: lba | {{#var:lba|}}{{#ifeq: {{lc:{{#if:{{{lba3|}}}|{{{lba3}}}|no}}}} | no || 3 }}}}{{
        |article=FunFrock's Reign}} }}}}{{
+
#ifexpr: {{#len:{{#var:lba|}}}} < 1
#vardefine: lba2 | {{#ifeq: {{lc: {{#if:{{{lba2|}}}|{{{lba2}}}|no}}}} | no |
+
|{{maintenance task|nocat={{{nocat|false}}} <!-- all options are invalid -->
    | {{categorizer|display=infobox|nocat={{{nocat|false}}}
+
  |category=Stories from an unknown adventure
        |category=LBA2 stories
+
  |doclink=Infobox Story/adventure
        |article=Twinsen's Odyssey}} }}}}{{
+
  |label=''unknown''
#vardefine: lba3 | {{#ifeq: {{lc: {{#if:{{{lba3|}}}|{{{lba3}}}|no}}}} | no |
+
  |reason=None of the '''lba1''', '''lba2''' and '''lba3''' parameters are specified}}
    | {{categorizer|display=infobox|nocat={{{nocat|false}}}
+
|{{
        |category=LBA3 stories
+
  #ifexpr: {{#len:{{#var:lba|}}}} > 1
        |article=Stellar Entity Genesis}} }}}}{{
+
  |{{categorizer|nocat={{{nocat|false}}} <!-- multiple options are valid -->
#switch:  
+
    |category=Continuing stories
| {{#var:lba1}}{{#var:lba2}}{{#var:lba3}} = {{maintenance task|nocat={{{nocat|false}}} <!-- all options are invalid -->
+
    |label=Multiple:}}
    |category=Stories from an unknown adventure
+
  </td></tr>
    |doclink=Infobox Story/adventure
+
  <tr><td colspan="2">}}{{list|range=3|separator={{#ifexpr: {{#len:{{#var:lba|}}}} <= 1|implode}}
    |label=''unknown''
+
  |{{#if: {{#pos:{{#var:lba|}}|1}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA1 stories|article=FunFrock's Reign}}}}
    |reason=None of the '''lba1''', '''lba2''' and '''lba3''' parameters are specified}}
+
  |{{#if: {{#pos:{{#var:lba|}}|2}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA2 stories|article=Twinsen's Odyssey}}}}
| {{#var:lba1}}{{#var:lba2}}
+
  |{{#if: {{#pos:{{#var:lba|}}|3}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA3 stories|article=Stellar Entity Genesis}}}} }}
| {{#var:lba1}}{{#var:lba3}}
+
}}</includeonly><noinclude>{{Infobox Template
| {{#var:lba2}}{{#var:lba3}} = {{#var:lba1}}{{#var:lba2}}{{#var:lba3}} <!-- only one option is valid -->
+
|purpose=infobox
| #default = {{categorizer|display=infobox|nocat={{{nocat|false}}} <!-- multiple options are valid -->
+
|singletag=no
        |category=Continuing stories
+
|multiline=optional
        |label=Multiple:}}
+
|gamerelated=yes
    </td></tr>
+
|suppressible=recursively
    <tr><td colspan="2"><ul>{{
+
|choice=multiple
        #if:{{#var:lba1}}|<li>{{#var:lba1}}</li>}}{{
+
|cat1=LBA1 stories!lba1
        #if:{{#var:lba2}}|<li>{{#var:lba2}}</li>}}{{
+
|cat2=LBA2 stories!lba2
        #if:{{#var:lba3}}|<li>{{#var:lba3}}</li>}}</ul>
+
|cat3=LBA3 stories!lba3
}}</includeonly><noinclude>
+
|cat4=Continuing stories!''multiple''
 +
|cat5=Stories from an unknown adventure!''unknown''!maintenance
 +
|var1=lba
 +
}}
 +
 
 
This template offers a multiple choice for defining which adventure a (story) article belongs to. It can also automatically categorize a page under that category.
 
This template offers a multiple choice for defining which adventure a (story) article belongs to. It can also automatically categorize a page under that category.
  
Line 109: Line 113:
 
This would render the same result as the first example above, but would not automatically categorize under [[:Category:LBA1 stories]]. This feature works both on valid values and the maintenance task mentioned above.
 
This would render the same result as the first example above, but would not automatically categorize under [[:Category:LBA1 stories]]. This feature works both on valid values and the maintenance task mentioned above.
  
[[Category:Categorizers|story]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 22:43, 10 June 2014

Infobox Story/adventure
Purpose

Infobox [list all]

Single tag

No [list all]

Multi-line

Optional [list all]

Protected

No [list all]

Game related

Yes [list all]

Categorization
Suppressible

Recursively [list all]

Choice

Multiple categories [list all]

Categories

Multiple: [list all]

Variables
Names

One: [list all]

  • lba  (free for reuse)
Subpages

This template offers a multiple choice for defining which adventure a (story) article belongs to. It can also automatically categorize a page under that category.

Parameters

  • lba1: Whether or not to select the first adventure "FunFrock's Reign" (defaults to no, enable by any other nonempty value)
  • lba2: Whether or not to select the second adventure "Twinsen's Odyssey" (defaults to no, enable by any other nonempty value)
  • lba3: Whether or not to select the third adventure "Stellar Entity Genesis" (defaults to no, enable by any other nonempty value)
  • nocat: Whether or not to suppress categorization under the chosen categories (defaults to false, which means auto categorization).


Note: the lba3 parameter is of cource a placeholder for until the highly anticipated sequel is finally released. Do not use it yet.

Note: this categorizer is multiple choice: you can specify any combination of the three options.

Note: if neither lba1, lba2 or lba3 specify a positive value, the default 'unknown' will be used.

Syntax

{{Infobox Story/adventure|lba1=value|lba2=value|lba3=value}}

Examples

Common use include either the lba1 or lba2 parameter to specify the one adventure a story is in (value "yes" is recommended):

{{Infobox Story/adventure|lba1=yes}}
{{Infobox Story/adventure|lba2=yes}}
FunFrock's Reign [list all]
Twinsen's Odyssey [list all]


You can also specify multiple adventures for one story (warning: this will force a table cell to split in two, so do not do this outside table cells!):

{{Infobox Story/adventure|lba1=yes|lba2=yes}}
Multiple: [list all]


It doesn't matter which value you use, any nonempty value other than "no" will express a positive value, so these all have the same result:

{{Infobox Story/adventure|lba1=aye, let's do this!}}
{{Infobox Story/adventure|lba1=false}}
{{Infobox Story/adventure|lba1=not}}
{{Infobox Story/adventure|lba1=maybe}}
{{Infobox Story/adventure|lba1=0}}
{{Infobox Story/adventure|lba1=zero}}
{{Infobox Story/adventure|lba1=null}}
{{Infobox Story/adventure|lba1=n}}
{{Infobox Story/adventure|lba1=whatever}}
{{Infobox Story/adventure|lba1=yes}}
{{Infobox Story/adventure|lba1=YES}}
FunFrock's Reign [list all]


The only ways to express a negative value is by leaving out the parameter, leaving it empty or specifying "no" (case insensitive), so these all have the same result:

{{Infobox Story/adventure|lba1=yes}}
{{Infobox Story/adventure|lba1=yes|lba2=}}
{{Infobox Story/adventure|lba1=yes|lba2=no}}
{{Infobox Story/adventure|lba1=yes|lba2=NO}}
FunFrock's Reign [list all]


When the in-game content of Little Big Adventure 3 is publicized, it may be specified as the adventure as well:

{{Infobox Story/adventure|lba3=yes}}
Stellar Entity Genesis [list all]


You may leave the "adventure" undefined (which would raise the Stories from an unknown adventure maintenance task) by not specifying any positive value for any of the options, so these all have the same result:

{{Infobox Story/adventure}}
{{Infobox Story/adventure|lba1=no}}
{{Infobox Story/adventure|lba1=|lba2=|lba3=}}
unknown [list all]


The nocat parameter may be used to suppress automatic categorization like this (any value will do):

{{Infobox Story/adventure|lba1=yes|nocat=true}}

This would render the same result as the first example above, but would not automatically categorize under Category:LBA1 stories. This feature works both on valid values and the maintenance task mentioned above.