Static List Content: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Jmarshall
No edit summary
>Jmarshall
No edit summary
Line 4: Line 4:
<xml>
<xml>
<content>
<content>
   <item>
   <item id="1">
     <label>My First Item</label>
     <label>My First Item</label>
     <label2>Item 1, Label 2</label2>
     <label2>Item 1, Label 2</label2>
Line 10: Line 10:
     <thumb>thumb1.png</thumb>
     <thumb>thumb1.png</thumb>
     <onclick>ActivateWindow(Home)</onclick>
     <onclick>ActivateWindow(Home)</onclick>
    <visible>true</visible>
   </item>
   </item>
   <item>
   <item id="2">
     <label>My Second Item</label>
     <label>My Second Item</label>
     <label2>Item 2, Label 2</label2>
     <label2>Item 2, Label 2</label2>
Line 24: Line 25:
The available XML tags for each item are as follows.  Note that, as always, they're lower-case only, as XML is case-sensitive.
The available XML tags for each item are as follows.  Note that, as always, they're lower-case only, as XML is case-sensitive.
{| class="dtable"
{| class="dtable"
|- class="userrow"
| class="usercell" | '''id'''
| class="usercell" | The id of the item.  Useful for external visibility conditions such as Container.HasFocus(3).
|- class="userrow"
|- class="userrow"
| class="usercell" | '''label'''
| class="usercell" | '''label'''
Line 39: Line 43:
| class="usercell" | '''onclick'''
| class="usercell" | '''onclick'''
| class="usercell" | The action to be performed when this item is clicked. Should be a built in function. [[Built-in functions available to FTP, Webserver, skins, keymap and to python|See here for more information.]]
| class="usercell" | The action to be performed when this item is clicked. Should be a built in function. [[Built-in functions available to FTP, Webserver, skins, keymap and to python|See here for more information.]]
|- class="userrow"
| class="usercell" | '''visible'''
| class="usercell" | The conditional visibility by which to show this item. [[Built-in functions available to FTP, Webserver, skins, keymap and to python|See here for more information.]]
|}
|}
[[category:Skin Development]]
[[category:Skin Development]]

Revision as of 23:21, 19 August 2007

Container controls (the List Container, Fixed List Container, Wrap List Container, and Panel Container) can be setup by the skinner with some predefined static content. This is done by including the <content> tag in the control. This allows skinners to have lists (or panels) of buttons wherever they want in the skin. The content below could be made separate in a different file for user editting, allowing users to have control over what goes on their home page for instance.

Example

<xml> <content>

 <item id="1">
   <label>My First Item</label>
   <label2>Item 1, Label 2</label2>
   <icon>icon1.png</icon>
   <thumb>thumb1.png</thumb>
   <onclick>ActivateWindow(Home)</onclick>
   <visible>true</visible>
 </item>
 <item id="2">
   <label>My Second Item</label>
   <label2>Item 2, Label 2</label2>
   <icon>icon2.png</icon>
   <thumb>thumb2.png</thumb>
   <onclick>ActivateWindow(MyMusicLibrary)</onclick>
 </item>

</content> </xml>

Available tags

The available XML tags for each item are as follows. Note that, as always, they're lower-case only, as XML is case-sensitive.

id The id of the item. Useful for external visibility conditions such as Container.HasFocus(3).
label The main label of the item. You can reference this within the <itemlayout> of the list via ListItem.Label.
label2 The secondary label of the item. You can reference this within the <itemlayout> of the list via ListItem.Label2.
icon The icon of the item. You can reference this within the <itemlayout> of the list via ListItem.Icon, or ListItem.ActualIcon.
thumb The thumbnail image of the item. You can reference this within the <itemlayout> of the list via ListItem.Thumb.
onclick The action to be performed when this item is clicked. Should be a built in function. See here for more information.
visible The conditional visibility by which to show this item. See here for more information.