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

From Twinsuniverse
Jump to: navigation, search
(Created page with "<includeonly> <nowiki>{{{...stub...}}}</nowiki> </includeonly><noinclude> This ... {{stub}} character </noinclude>")
 
Line 1: Line 1:
<includeonly>
+
<includeonly>{{
<nowiki>{{{...stub...}}}</nowiki>
+
#if: {{{1|}}}
</includeonly><noinclude>
+
| {{
This ...
+
  #ifexist: File:{{{1}}}
{{stub}}
+
  |{{#ifeq: {{#iferror: {{#ifexpr: {{#if:{{{amount|}}}|{{{amount}}}}}>0 | ({{{amount}}}x) }}}} || none of: }}
 +
      [[{{{1}}}]]
 +
  |(...) [[{{{1}}}|missing requirement]]{{
 +
      #ifeq: {{{nocat|false}}} | false | [[Category:Characters with a missing requirement]]}}}}
 +
}}</includeonly><noinclude>
 +
This template displays an [[:Category:Inventory Items|Inventory Items]] requirement with an amount. It is used to specify what a character requires to be able to be talked to or use their service(s). This also automatically categorizes the article under [[:Category:Characters with a missing requirement]] when the specified article doesn't exist yet.
 +
 
 +
==Parameters==
 +
# The pagename of an article from [[:Category:Inventory Items]] or a subcategory (no parameter name but value is case sensitive, defaults to nothing displayed)
 +
* '''amount''': A number representing the amount of said requirement (positive numeric, defaults to string "none of:")
 +
* '''nocat''': Whether or not to suppress categorization in case of an invalid requirement articlename (defaults to false, which means auto categorization).
 +
 
 +
 
 +
'''''Note''': Eventhough the numbered (pagename) parameter is optional, it is required for anything to be displayed at all, in which case it has to be an existing article.''
 +
 
 +
==Syntax==
 +
<nowiki>{{infobox character/requires|articlename|amount=number}}</nowiki>
 +
 
 +
==Examples==
 +
Common use includes both the filename and '''amount''' parameters, with the latter accepting a mathematical expression:
 +
<nowiki>{{infobox character/requires|Kashes|amount=10}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=2 + 6}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=3 * 4}}</nowiki>
 +
 
 +
:(10x) [[Kashes]]
 +
:(8x) [[Kashes]]
 +
:(12x) [[Kashes]]
 +
 
 +
 
 +
The order in which the parameters are specified is not important, so these all have the same result:
 +
<nowiki>{{infobox character/requires|Zlitos|amount=30}}</nowiki>
 +
<nowiki>{{infobox character/requires|1=Zlitos|amount=30}}</nowiki>
 +
<nowiki>{{infobox character/requires|amount=30|Zlitos}}</nowiki>
 +
<nowiki>{{infobox character/requires|amount=30|1=Zlitos}}</nowiki>
 +
 
 +
:(30x) [[Zlitos]]
 +
 
 +
 
 +
When an invalid number is specified for the '''amount''' (which would not raise any maintenanance task, [[Template talk:{{PAGENAME}}|discuss]]), it defaults to "none of:", so these all have the same result:
 +
<nowiki>{{infobox character/requires|Kashes}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=three}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=many}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=3 + one}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=3 +}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=@}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=none of:}}</nowiki>
 +
<nowiki>{{infobox character/requires|Kashes|amount=noooone of:}}</nowiki>
 +
 
 +
:none of: [[Kashes]]
 +
 
 +
 
 +
You may leave "requires" undefined (which would not raise any maintenance task) by not specifying any articlename, so these all have the same result (nothing displayed):
 +
<nowiki>{{infobox character/requires}}</nowiki>
 +
<nowiki>{{infobox character/requires|}}</nowiki>
 +
<nowiki>{{infobox character/requires|1=}}</nowiki>
 +
<nowiki>{{infobox character/requires|amount=3}}</nowiki>
 +
<nowiki>{{infobox character/requires||amount=3}}</nowiki>
 +
<nowiki>{{infobox character/requires|1=|amount=3}}</nowiki>
 +
<nowiki>{{infobox character/requires|5=Possibly existing article name|amount=3}}</nowiki>
 +
<nowiki>{{infobox character/requires|      |amount=3}}</nowiki>
 +
 
 +
 
 +
When a nonexisting articlename is specified (which would raise the [[:Category:Characters with a missing requirement|Characters with a missing requirement]] maintenanance task), a red-link is displayed for it and the amount hidden like this:
 +
<nowiki>{{infobox character/requires|Nonexisting Item|amount=10}}</nowiki>
 +
 
 +
:(...) [[Nonexisting Item|missing requirement]]
 +
 
 +
 
 +
The '''nocat''' parameter may be used to suppress automatic categorization like this (any value will do):
 +
<nowiki>{{infobox character/requires|Nonexisting Item|amount=10|nocat=true}}</nowiki>
 +
 
 +
This would render the same result as the last example above, but would not categorize under [[:Category:Characters with a missing requirement]]. This feature works on any nonempty nonexisting articlename.
  
 
[[Category:Article Categorizers|character]]
 
[[Category:Article Categorizers|character]]
 
</noinclude>
 
</noinclude>

Revision as of 15:12, 25 November 2012

This template displays an Inventory Items requirement with an amount. It is used to specify what a character requires to be able to be talked to or use their service(s). This also automatically categorizes the article under Category:Characters with a missing requirement when the specified article doesn't exist yet.

Parameters

  1. The pagename of an article from Category:Inventory Items or a subcategory (no parameter name but value is case sensitive, defaults to nothing displayed)
  • amount: A number representing the amount of said requirement (positive numeric, defaults to string "none of:")
  • nocat: Whether or not to suppress categorization in case of an invalid requirement articlename (defaults to false, which means auto categorization).


Note: Eventhough the numbered (pagename) parameter is optional, it is required for anything to be displayed at all, in which case it has to be an existing article.

Syntax

{{infobox character/requires|articlename|amount=number}}

Examples

Common use includes both the filename and amount parameters, with the latter accepting a mathematical expression:

{{infobox character/requires|Kashes|amount=10}}
{{infobox character/requires|Kashes|amount=2 + 6}}
{{infobox character/requires|Kashes|amount=3 * 4}}
(10x) Kashes
(8x) Kashes
(12x) Kashes


The order in which the parameters are specified is not important, so these all have the same result:

{{infobox character/requires|Zlitos|amount=30}}
{{infobox character/requires|1=Zlitos|amount=30}}
{{infobox character/requires|amount=30|Zlitos}}
{{infobox character/requires|amount=30|1=Zlitos}}
(30x) Zlitos


When an invalid number is specified for the amount (which would not raise any maintenanance task, discuss), it defaults to "none of:", so these all have the same result:

{{infobox character/requires|Kashes}}
{{infobox character/requires|Kashes|}}
{{infobox character/requires|Kashes|amount=}}
{{infobox character/requires|Kashes|amount=three}}
{{infobox character/requires|Kashes|amount=many}}
{{infobox character/requires|Kashes|amount=3 + one}}
{{infobox character/requires|Kashes|amount=3 +}}
{{infobox character/requires|Kashes|amount=@}}
{{infobox character/requires|Kashes|amount=none of:}}
{{infobox character/requires|Kashes|amount=noooone of:}}
none of: Kashes


You may leave "requires" undefined (which would not raise any maintenance task) by not specifying any articlename, so these all have the same result (nothing displayed):

{{infobox character/requires}}
{{infobox character/requires|}}
{{infobox character/requires|1=}}
{{infobox character/requires|amount=3}}
{{infobox character/requires||amount=3}}
{{infobox character/requires|1=|amount=3}}
{{infobox character/requires|5=Possibly existing article name|amount=3}}
{{infobox character/requires|      |amount=3}}


When a nonexisting articlename is specified (which would raise the Characters with a missing requirement maintenanance task), a red-link is displayed for it and the amount hidden like this:

{{infobox character/requires|Nonexisting Item|amount=10}}
(...) missing requirement


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

{{infobox character/requires|Nonexisting Item|amount=10|nocat=true}}

This would render the same result as the last example above, but would not categorize under Category:Characters with a missing requirement. This feature works on any nonempty nonexisting articlename.