21 Aug 2020 - The wiki is undergoing a major cleanup. If you arrived here from a search engine and cannot find the page, please use the wiki search instead (top right corner of page)
More info can be found on the forum

Difference between revisions of "Static List Content"

From Official Kodi Wiki
Jump to: navigation, search
(Plugin provided content)
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
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. You can use <defaultcontrol [always="true"]>id</defaultcontrol> to control which item in the list gets focssed by default.
+
<section begin="main content" />
 +
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 used on the home page for instance. You can use <defaultcontrol [always="true"]>id</defaultcontrol> to control which item in the list gets focused by default.
  
 
=== Example ===
 
=== Example ===
<source lang="xml">
+
<syntaxhighlight lang="XML" enclose="div">
 
<content>
 
<content>
 
   <item id="1">
 
   <item id="1">
Line 9: Line 10:
 
     <icon>icon1.png</icon>
 
     <icon>icon1.png</icon>
 
     <thumb>thumb1.png</thumb>
 
     <thumb>thumb1.png</thumb>
     <onclick>ActivateWindow(Home)</onclick>
+
     <onclick>ActivateWindow(Videos)</onclick>
 
     <visible>true</visible>
 
     <visible>true</visible>
 
     <property name="foo">Some1stValueHere</property>
 
     <property name="foo">Some1stValueHere</property>
Line 19: Line 20:
 
     <icon>icon2.png</icon>
 
     <icon>icon2.png</icon>
 
     <thumb>thumb2.png</thumb>
 
     <thumb>thumb2.png</thumb>
     <onclick>ActivateWindow(MyMusicLibrary)</onclick>
+
     <onclick>ActivateWindow(Music)</onclick>
 
     <property name="foo">Some1stValueHere</property>
 
     <property name="foo">Some1stValueHere</property>
 
     <property name="foo2">Some2ndValueHere</property>
 
     <property name="foo2">Some2ndValueHere</property>
 
   </item>
 
   </item>
 
</content>
 
</content>
</source>
+
</syntaxhighlight>
  
 
=== Available tags ===
 
=== 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.
 
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="wikitable"
+
 
 +
{| class="prettytable"
 +
! Tag !! Description
 
|-  
 
|-  
 
|  '''id'''
 
|  '''id'''
Line 46: Line 49:
 
|-  
 
|-  
 
|  '''onclick'''
 
|  '''onclick'''
|  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.]]
+
|  The action to be performed when this item is clicked. Should be a built in function. [[Built-in_scripting|See here for more information.]]
 
|-  
 
|-  
 
|  '''visible'''
 
|  '''visible'''
|  Specifies a condition as to when this item will be visible within the container. Can be true, false, or a condition. [[Conditional Visibility|See here for&nbsp;more information.]]  Defaults to true.
+
|  Specifies a condition as to when this item will be visible within the container. Can be true, false, or a condition. [[Conditional_visibility|See here for&nbsp;more information.]]  Defaults to true.
 
|-  
 
|-  
 
|  '''property'''
 
|  '''property'''
 
|  Property of the item. You can reference this within the [[Container Item Layout|<itemlayout>]] of the list via ListItem.Property(name).
 
|  Property of the item. You can reference this within the [[Container Item Layout|<itemlayout>]] of the list via ListItem.Property(name).
 
|}
 
|}
 
+
<section end="main content" />
=== Plugin provided content ===
 
As of XBMC Gotham, it's also possible to fill list containers with content provided by a plugin:
 
<source lang="xml">
 
<content target="video">plugin://plugin.test.me?arg1=foo</content>
 
</source>
 
 
 
 
== See also ==
 
== See also ==
 
'''Development:'''
 
'''Development:'''
Line 66: Line 63:
 
* [[Skinning]]
 
* [[Skinning]]
  
[[Category:Skin Development]]
+
[[Category:Skin development]]

Latest revision as of 04:48, 20 July 2020

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 used on the home page for instance. You can use <defaultcontrol [always="true"]>id</defaultcontrol> to control which item in the list gets focused by default.

1 Example

<content>
  <item id="1">
    <label>My First Item</label>
    <label2>Label 2</label2>
    <icon>icon1.png</icon>
    <thumb>thumb1.png</thumb>
    <onclick>ActivateWindow(Videos)</onclick>
    <visible>true</visible>
    <property name="foo">Some1stValueHere</property>
    <property name="foo2">Some2ndValueHere</property>
  </item>
  <item id="2">
    <label>My Second Item</label>
    <label2>Label 2</label2>
    <icon>icon2.png</icon>
    <thumb>thumb2.png</thumb>
    <onclick>ActivateWindow(Music)</onclick>
    <property name="foo">Some1stValueHere</property>
    <property name="foo2">Some2ndValueHere</property>
  </item>
</content>

2 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.

Tag Description
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 Specifies a condition as to when this item will be visible within the container. Can be true, false, or a condition. See here for more information. Defaults to true.
property Property of the item. You can reference this within the <itemlayout> of the list via ListItem.Property(name).

3 See also

Development: