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

From Twinsuniverse
Jump to: navigation, search
m
m (indentation)
 
(35 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|nocat={{{nocat|false}}}
+
#vardefine: lba | {{#var:lba|}}{{#ifeq: {{lc:{{#if:{{{lba2|}}}|{{{lba2}}}|no}}}} | no || 2 }}}}{{
        |category=LBA1 Characters
+
#vardefine: lba | {{#var:lba|}}{{#ifeq: {{lc:{{#if:{{{lba3|}}}|{{{lba3}}}|no}}}} | no || 3 }}}}{{
        |label=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|nocat={{{nocat|false}}}
+
  |category=Characters from an unknown adventure
        |category=LBA2 Characters
+
  |doclink=Infobox Character/adventure
        |label=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|nocat={{{nocat|false}}}
+
|{{
        |category=LBA3 Characters
+
  #ifexpr: {{#len:{{#var:lba|}}}} > 1
        |label=Stellar Entity Genesis}} }}}}{{
+
  |{{categorizer|nocat={{{nocat|false}}} <!-- multiple options are valid -->
#vardefine: adventure |}}{{
+
    |category=Recurring characters
#vardefine: adventure |{{#var:adventure}}{{#if: {{#var:lba1}} |<li>{{#var:lba1}}</li>}} }}{{
+
    |label=Multiple:}}
#vardefine: adventure |{{#var:adventure}}{{#if: {{#var:lba2}} |<li>{{#var:lba2}}</li>}} }}{{
+
  </td></tr>
#vardefine: adventure |{{#var:adventure}}{{#if: {{#var:lba3}} |<li>{{#var:lba3}}</li>}} }}{{
+
  <tr><td colspan="2">}}{{list|range=3|separator={{#ifexpr: {{#len:{{#var:lba|}}}} <= 1|implode}}
#vardefine: adventure |{{#if: {{#var:adventure}} | <ul>{{#var:adventure}}</ul> }} }}{{
+
  |{{#if: {{#pos:{{#var:lba|}}|1}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA1 characters|article=FunFrock's Reign}}}}
#switch:
+
  |{{#if: {{#pos:{{#var:lba|}}|2}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA2 characters|article=Twinsen's Odyssey}}}}
| {{#var:lba1}}{{#var:lba2}}{{#var:lba3}} = {{categorizer|nocat={{{nocat|false}}} <!-- when all parameters are empty/undefined -->
+
  |{{#if: {{#pos:{{#var:lba|}}|3}} | {{categorizer|nocat={{{nocat|false}}}|category=LBA3 characters|article=Stellar Entity Genesis}}}} }}
        |category=Characters from an unknown adventure
+
}}</includeonly><noinclude>{{Infobox Template
        |label=unknown}}
+
|purpose=infobox
| {{#var:lba1}}{{#var:lba2}}
+
|singletag=no
| {{#var:lba1}}{{#var:lba3}}
+
|multiline=optional
| {{#var:lba2}}{{#var:lba3}} = {{#var:lba1}}{{#var:lba2}}{{#var:lba3}} <!-- when only one parameter is specified -->
+
|gamerelated=yes
| #default = {{categorizer|nocat={{{nocat|false}}} <!-- when multiple parameters are specified -->
+
|suppressible=recursively
        |category=Recurring Characters
+
|choice=multiple
        |label=Multiple}}:
+
|cat1=LBA1 characters!lba1
    </td></tr>
+
|cat2=LBA2 characters!lba2
    <tr><td colspan="2">{{#var:adventure}}
+
|cat3=LBA3 characters!lba3
}}</includeonly><noinclude>
+
|cat4=Recurring characters!''multiple''
 +
|cat5=Characters from an unknown adventure!''unknown''!maintenance
 +
|var1=lba
 +
}}
 +
 
 
This template offers a multiple choice for defining which adventure a (character) article belongs to. It can also automatically categorize a page under that category.
 
This template offers a multiple choice for defining which adventure a (character) article belongs to. It can also automatically categorize a page under that category.
  
 
==Parameters==
 
==Parameters==
* '''lba1''': Whether or not to select the first adventure "FunFrock's Reign" (defaults to no, enable by any other nonempty value)
+
* '''lba1''': Whether or not to select the first adventure "FunFrock's Reign" (any value will do, defaults to "no")
* '''lba2''': Whether or not to select the second adventure "Twinsen's Odyssey" (defaults to no, enable by any other nonempty value)
+
* '''lba2''': Whether or not to select the second adventure "Twinsen's Odyssey" (any value will do, defaults to "no")
* '''lba3''': Whether or not to select the third adventure "Stellar Entity Genesis" (defaults to no, enable by any other nonempty value)
+
* '''lba3''': Whether or not to select the third adventure "Stellar Entity Genesis" (any value will do, defaults to "no")
 
* '''nocat''': Whether or not to suppress categorization under the chosen categories (defaults to false, which means auto categorization).
 
* '''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:''' 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:''' this categorizer is multiple choice: you can specify any combination of the three options.''
  
'''''Note:''' if neither '''lba1''', '''lba2''' or '''lba3''' are specified, the default will be 'unknown'.''
+
'''''Note:''' if neither '''lba1''', '''lba2''' or '''lba3''' specify a positive value, the default 'unknown' will be used.''
  
 
==Syntax==
 
==Syntax==
  <nowiki>{{adventure|lba1=value|lba2=value|lba3=value}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=value|lba2=value|lba3=value}}</nowiki>
  
 
==Examples==
 
==Examples==
Common use of the Adventure categorizer include either '''lba1''' or '''lba2''' parameters:
+
Common use include either the '''lba1''' or '''lba2''' parameter to specify the one adventure a character is in (value "yes" is recommended):
  <nowiki>{{adventure|lba1=yes}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=yes}}</nowiki>
 
+
  <nowiki>{{Infobox Character/adventure|lba2=yes}}</nowiki>
:{{categorizer|category=LBA1 Characters|label=FunFrock's Reign|nocat=true}}
+
 
+
 
+
Or specify the other adventure like this:
+
  <nowiki>{{adventure|lba2=yes}}</nowiki>
+
  
:{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
:{{categorizer|category=LBA1 characters|article=FunFrock's Reign|nocat=true}}
 +
:{{categorizer|category=LBA2 characters|article=Twinsen's Odyssey|nocat=true}}
  
  
Or when multiple options apply (<span style="color:red">warning</span>: only works within HTML table cells!):
+
You can also specify multiple adventures for one character (<span style="color:red">warning</span>: this will force a table cell to split in two, so do not do this outside table cells!):
  <nowiki>{{adventure|lba1=yes|lba2=yes}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=yes|lba2=yes}}</nowiki>
  
:{{categorizer|category=Recurring Characters|label=Multiple|nocat=true}}:
+
:{{categorizer|category=Recurring characters|label=Multiple:|nocat=true}}
:*{{categorizer|category=LBA1 Characters|label=FunFrock's Reign|nocat=true}}
+
:*{{categorizer|category=LBA1 characters|article=FunFrock's Reign|nocat=true}}
:*{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
:*{{categorizer|category=LBA2 characters|article=Twinsen's Odyssey|nocat=true}}
  
  
It doesn't matter what value you specify, any will do:
+
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:
  <nowiki>{{adventure|lba2=aye, let's do this!}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=aye, let's do this!}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=false}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=not}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=maybe}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=0}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=zero}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=null}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=n}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=whatever}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=yes}}</nowiki>
 +
<nowiki>{{Infobox Character/adventure|lba1=YES}}</nowiki>
  
:{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
:{{categorizer|category=LBA1 characters|article=FunFrock's Reign|nocat=true}}
  
  
Notice the negative value of any of the three options is "no" (case insensitive):
+
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:
  <nowiki>{{adventure|lba2=false}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=yes}}</nowiki>
  <nowiki>{{adventure|lba2=not}}</nowiki>
+
<nowiki>{{Infobox Character/adventure|lba1=yes|lba2=}}</nowiki>
  <nowiki>{{adventure|lba2=maybe}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=yes|lba2=no}}</nowiki>
 +
  <nowiki>{{Infobox Character/adventure|lba1=yes|lba2=NO}}</nowiki>
  
:{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
:{{categorizer|category=LBA1 characters|article=FunFrock's Reign|nocat=true}}
:{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
:{{categorizer|category=LBA2 Characters|label=Twinsen's Odyssey|nocat=true}}
+
  
  
When the in-game content of LBA3 is publicized, it may be specified as the adventure as well:
+
When the in-game content of [[Little Big Adventure 3]] is publicized, it may be specified as the adventure as well:
  <nowiki>{{adventure|lba3=yes}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba3=yes}}</nowiki>
  
:{{categorizer|category=LBA3 Characters|label=Stellar Entity Genesis|nocat=true}}
+
:{{categorizer|category=LBA3 characters|article=Stellar Entity Genesis|nocat=true}}
  
  
You can also explicitly specify an adventure for exclusion (the same as leaving out the parameter or leaving it empty):
+
You may leave the "adventure" undefined (which would raise the [[:Category:Characters from an unknown adventure|Characters from an unknown adventure]] maintenance task) by not specifying any positive value for any of the options, so these all have the same result:
  <nowiki>{{adventure|lba1=yes|lba2=no}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure}}</nowiki>
  <nowiki>{{adventure|lba1=yes|lba2=}}</nowiki>
+
<nowiki>{{Infobox Character/adventure|lba1=no}}</nowiki>
 +
  <nowiki>{{Infobox Character/adventure|lba1=|lba2=|lba3=}}</nowiki>
  
:{{categorizer|category=LBA1 Characters|label=FunFrock's Reign|nocat=true}}
+
:{{categorizer|category=Characters from an unknown adventure|label=''unknown''|nocat=true}}
:{{categorizer|category=LBA1 Characters|label=FunFrock's Reign|nocat=true}}
+
  
  
 
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
 
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
  <nowiki>{{adventure|lba1=yes|nocat=true}}</nowiki>
+
  <nowiki>{{Infobox Character/adventure|lba1=yes|nocat=true}}</nowiki>
  
(this would render the same result as the first example above, but would not automatically categorize under [[:Category:LBA1 Characters]])
+
This would render the same result as the first example above, but would not automatically categorize under [[:Category:LBA1 characters]]. This feature works both on valid values and the maintenance task mentioned above.
  
[[Category:Article Categorizers]]</noinclude>
+
</noinclude>

Latest revision as of 23:42, 10 June 2014

Infobox Character/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 (character) 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" (any value will do, defaults to "no")
  • lba2: Whether or not to select the second adventure "Twinsen's Odyssey" (any value will do, defaults to "no")
  • lba3: Whether or not to select the third adventure "Stellar Entity Genesis" (any value will do, defaults to "no")
  • 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 Character/adventure|lba1=value|lba2=value|lba3=value}}

Examples

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

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


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

{{Infobox Character/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 Character/adventure|lba1=aye, let's do this!}}
{{Infobox Character/adventure|lba1=false}}
{{Infobox Character/adventure|lba1=not}}
{{Infobox Character/adventure|lba1=maybe}}
{{Infobox Character/adventure|lba1=0}}
{{Infobox Character/adventure|lba1=zero}}
{{Infobox Character/adventure|lba1=null}}
{{Infobox Character/adventure|lba1=n}}
{{Infobox Character/adventure|lba1=whatever}}
{{Infobox Character/adventure|lba1=yes}}
{{Infobox Character/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 Character/adventure|lba1=yes}}
{{Infobox Character/adventure|lba1=yes|lba2=}}
{{Infobox Character/adventure|lba1=yes|lba2=no}}
{{Infobox Character/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 Character/adventure|lba3=yes}}
Stellar Entity Genesis [list all]


You may leave the "adventure" undefined (which would raise the Characters 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 Character/adventure}}
{{Infobox Character/adventure|lba1=no}}
{{Infobox Character/adventure|lba1=|lba2=|lba3=}}
unknown [list all]


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

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

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