Import or include xml files in another skin xml
Import or Include
Skin files have the ability to import or include files into the skin markup using the <import> or <include> tags.
Note: These tags can only be used in a skin xml which contains a window ID. You cannot 'nest' or import files in a file that is already imported.
The concept is to move all the common markup into smaller and easier to manage files to minimize the amount of work required to create new skin files and to make it easier to maintain and modify existing skin files.
The <import> or <include> tag should be added to the <controls> section of the xml. The elements defined in the imported file will overlay elements which are defined previously in the xml, so the location of the <import> tag is significant.
Two of the most commonly imported files are common.window.xml, which defines elements common to most or all windows, and common.time.xml, which defines the display of the date and time on each window.
As of v 1.3.0 beta, skins may import files conditionally using the <include> tag
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:
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.
where #skin.tvguide.rows.is_short is controlled by a togglebutton, checkbutton, or menubutton (for example).
See also: Skin Expressions
This page has no comments.