Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Conditional <include> makes it easier for skinners to develop skins with the ability to customize the GUI presentation (layouts, optional elements, etc). For example, conditional <include> can help by adding skinnable behavior that provides for end-user selection between window layout 'A' vs. 'B'. Skin designers can build the skin xml for option A and for option B separately (in two different xml files) and then conditionally include one xml file over another based on a skinnable end-user selection using Skin Settings.
Conditional <include> functionality adds an attribute to the <include> tag as follows:

Code Block
languagephpxml
<include condition="_expression_">_file.xml_<>file.xml</include>


where expression is any valid skin expression or skin setting that evaluates to a boolean. If the result is "true" then the xml file is included, otherwise the xml file is not included. If the expression cannot be properly evaluated (e.g. the result is not a boolean) then the file is not included and a debug statement is written to the log.

Example:

Code Block
language

...

xml
<include condition="

...

#skin.tvguide.rows.is

...

_short

...

"

...

>mytvguide.8rows.

...

xml</include>
<include condition="

...

#(not(#skin.tvguide.rows.is

...

_short

...

)"

...

>mytvguide.10rows.

...

xml</include>

where #skin.tvguide.rows.is_short is controlled by a togglebutton, checkbutton, or menubutton (for example).
See also: Skin Expressions

...