Dynamic List Content

From Official Kodi Wiki
Revision as of 20:44, 26 October 2018 by Ronie (talk | contribs) (→‎Examples)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Container controls (the List Container, Fixed List Container, Wrap List Container, and Panel Container) can be setup by the skinner with dynamic content from a path or plugin. This is done by including the <content> tag in the control. It saves many lines of code as it's not necessary anymore to use static items for i.e. recently added movies.

1 Examples

Content filled from a plugin


Content filled from a path

<content target="music" sortby="artist" sortorder="ascending" limit="10">musicdb://recentlyaddedalbums/</content>

It's also possible to fill a container with multiple <content> sources.

2 Available attributes

The available XML attributes for the content tag are as follows. Note that, as always, they're lower-case only, as XML is case-sensitive.

Attributes Description
target Specifies the context window of the content. This is only necessary for folder items as it defines which window should be activated. For example musicdb://albums/ should have target="music" but musicdb://songs/ does not need a target because it contains only songs which will be played via PlayMedia(...) rather than opened via ActivateWindow(target,path,return)
limit Limits the number of items in the container.
sortby Sorts the list by the given value.
sortorder Sort direction of the list: ascending or descending.

3 Available item properties (can be filled in plugins)

Property Description
node.target Specifies the context window of the content. This overwrites the target attribute of the content tag.
node.target_url Overwrites the path of an item if it's clicked on. This can be used to show the content of the item's path in another container while entering a different path if the item is clicked on. An example would be Confluence's home screen where Movies shows the items of it's path as a submenu below while clicking the item always takes the user to movie titles.

4 Override onclick action

You can define a custom <onclick> action for lists with dynamic content.

<control type="list">

5 See also