Difference between revisions of "Template:SetProp/doc"

From Salem Wiki
Jump to: navigation, search
m (→‎Description: update with link to system documentation)
m (→‎Description: visual)
Line 4: Line 4:
 
:Some properties are fit to assign multiple values to, using a '''sep''', but those of type [[Special:Types/Boolean|Boolean]] are obviously not...
 
:Some properties are fit to assign multiple values to, using a '''sep''', but those of type [[Special:Types/Boolean|Boolean]] are obviously not...
  
;For more documentation on functions used see<nowiki>:</nowiki>
+
;For more documentation on functions used see:
:[http://semantic-mediawiki.org/wiki/Help:Properties_and_types#Silent_annotations_using_.23set Help:Properties and types (Silent annotations using #set)]
+
:*[http://semantic-mediawiki.org/wiki/Help:Properties_and_types#Silent_annotations_using_.23set Help:Properties and types (Silent annotations using #set)]
  
 
==Syntax==
 
==Syntax==

Revision as of 19:10, 29 June 2012

Description

This is a wrapper-template that calls {{SetProp/single}} to automatically set property values.
It has a fixed-set of properties it supports, and can be expanded when needed in code...
Some properties are fit to assign multiple values to, using a sep, but those of type Boolean are obviously not...
For more documentation on functions used see

Syntax

Type the below code somewhere on a page:
{{SetProp
|propname=propvalues
|propname=propvalues
|...
}}
It supports this optional named-parameter for multi-value propname's:
  • sep
    The default separator used in the propvalues to separate single-values from each other.
    It defaults to a comma ','

Supported propname's

It currently supports these properties in preferred sequence:

  • IsGameMenu (Type: Boolean, single-value)
    Will always be set.
    Defaults to 'false'.
  • IsinGameMenu (Type: String, multi-value)
    Default separator in this case is a ^ when no over-ride is used in sep, be careful this property can use a comma in its valid value!
  • Has icon (Type: Page, single-value)
    Only supply the filename, it will automatically prepend the final property-value with Image:
    When not used, it will auto-set this property to Image:{{SUBPAGENAME}} icon.png
  • Caption (Type: Text, single-value)
    Can hold free text.
  • Has fullview (Type: Page, single-value)
    Only supply the filename, it will automatically prepend the final property-value with Image:
  • RequiresTech (Type: Page, multi-value)
  • RequiresObj (Type: String, multi-value)
  • RepairedWith (Type: String, multi-value)
  • IsLiftable (Type: Boolean, single-value)
  • IsLiftableWhenEmpty (Type: Boolean, single-value)
    When used will always be set to 'true', and auto-set IsLiftable='true'.
  • HP (Type: Number, single-value)
  • Soak (Type: Number, single-value)

Examples

See the example(s) in the documentation of {{SetProp/single}}, this template just passes known multi-value properties with their values to it.
Or directly uses {{#set:propname=propvalue}} for single-value properties.