2011-10-01, 13:37
Added new mechanism: Skin Variables
It allow defining custom "infolabels" - skin variables to avoid duplicating similiar controls that differs only by visibility condition and label/texture
How to use:
Here's more "real world example": Confluence using Skin Variables to display codec icons
It allow defining custom "infolabels" - skin variables to avoid duplicating similiar controls that differs only by visibility condition and label/texture
How to use:
- We need to define our variable (important - we do it in includes.xml or other xml that is included there)
var_name - name of variable - will be used to access its valueCode:<variable name="var_name" [type="text"]>
<value condition="condition_1">value 1</value>
<value condition="condition_2">$INFO[some_infolabel]</value>
<value>default value</value>
</variable>
[type="text"] - this mark type of the variable (it's "text" by default so You can ommit it) - in future I plan to add "numeric" and "boolean" types
Variable checks conditions going from top of the list: if condition_1 is true then variable will have value "value 1". If it's false it go to next line. If condition isn't specified, we simply use given value.
- Use it in our control:
Code:<control type="label">
<label>$VAR[var_name]</label>
[ ... ]
</control>
Here's more "real world example": Confluence using Skin Variables to display codec icons