Template:Condition: Difference between revisions
From Mediawiki1
Jump to navigationJump to search
No edit summary |
|||
Line 43: | Line 43: | ||
=== Meanings === | === Meanings === | ||
* '''templateProperty''': | * '''templateProperty''': Define for which template property the condition has to apply. | ||
* '''operator''': | * '''operator''': Possible values: ''isSet'', ''equals'', ''contains''. | ||
* '''value''': | ** ''isSet'': Condition applies if template property is set (contains any value). | ||
* '''mapping''': | ** ''equals'': Condition applies if template property equals ''value''. | ||
* '''otherwise''': | ** ''contains'': Condition applies if template property contains ''value''. | ||
* '''value''': If the operator value is ''equals'' or ''contains'', define the template property value here. | |||
* '''mapping''': If the condition applies, the TemplateMapping defined here are applied. | |||
* '''otherwise''': otherwise is only to be used for the last condition of a ConditionalMapping. It equals the else case and defines the template mapping if none of the conditions defined before apply. | |||
=== Example === | === Example === |
Revision as of 11:46, 8 March 2010
{{Condition}}s are cases of a {{ConditionalMapping}}. They define the template property conditions and their result on the template mapping.
Usage
{{Condition | templateProperty = | operator = | value = | mapping = }}
{{Condition | otherwise | mapping = }}
Meanings
- templateProperty: Define for which template property the condition has to apply.
- operator: Possible values: isSet, equals, contains.
- isSet: Condition applies if template property is set (contains any value).
- equals: Condition applies if template property equals value.
- contains: Condition applies if template property contains value.
- value: If the operator value is equals or contains, define the template property value here.
- mapping: If the condition applies, the TemplateMapping defined here are applied.
- otherwise: otherwise is only to be used for the last condition of a ConditionalMapping. It equals the else case and defines the template mapping if none of the conditions defined before apply.
Example
{{Condition | templateProperty = 1 | operator = equals | value = River | mapping = {{TemplateMapping | mapToClass = River }} }}
{{Condition | otherwise | mapping = {{TemplateMapping | mapToClass = Island }} }}