Treat ListItems differently in same folder
#1
Hi,

I'm trying to learn something about skinning in XBMC and have started to experiment by modding the Confluence skin. My goal is to be able to make a view (mainly to be used with some addons I've been playing around with) that can consist of a menu, submenus and content divided by categories. The Netflix website is a good example of what I'm imagining:

Image

It contains a top menu, with some of the menu items activating a submenu. Below are the videos, where each row is scrollable and represents it's own category.

Now, if I understand correctly, the View gets a bunch of ListItems from the plugin. These ListItems are then presented in a way the skin decides - but I don't really see a way to separate different ListItems from each other? And then, i suppose my current idea of how to achieve this won't work, but maybe there's some way to treat ListItems differently depending on a certain Property, or something like that. Then you could, in the addon, assign, let's say, an 'ItemType'-property to the items and then set this property to either 'Menu', 'Submenu', 'Content1', 'Content2' etc. The skin then places these items accordingly.

However, I have a feeling that this is not possible, from looking at the Thumbnail view in confluence - and that this is something that needs to be done by a script - but I'm hoping some skin expert could prove me wrong Smile
Reply
#2
Have you tried conditional visibility? I'm not a skin expert, but I think that can be done with conditions.
In your screenshot there are lists for each genre, so if you want to make something similar, you have to create a list control for each genre with a visibility condition inside itemlayout and focusedlayout tags:

Code:
<itemlayout width="item_width" height="item_height" condition="StringCompare(ListItem.Genre,yourgenre)">
     (your controls)
</itemlayout>

<focusedlayout width="item_width" height="item_height" condition="StringCompare(ListItem.Genre,yourgenre)">
     (your controls)
</focusedlayout>

This way the item is displayed only if the item's genre equals whatever "yourgenre" is.

And if you want to display only genres the user has chosen, you can use radiobuttons in your submenu and a visibility condition inside the list control.

That should do the trick, but I don't know if it works with plug-ins because I haven't tried.
Reply
#3
Hey thanks! This sound promising. Smile I'll tinker with this for awhile and let you know if I manage to mage something of it.
Reply
#4
Tried it now but unfortunately the condition code seems to have no effect. I made two list controls, one for menu items and one for main content. In the plugin I assigned each listitem the property "ItemType" and set it to "menu" for the menu items and "content1" for the main content items. Then in each list control I typed:
Code:
<itemlayout height="25" width="200" condition="StringCompare(ListItem.Property(ItemType), menu)">
</itemlayout>
(in the Main Content list control I replaced "menu" with "content1")

Only the first list control appears and it contains all of the items Sad

I haven't figured out how to make the second list control appear. I gave it a unique id (should I declare it in some other file - I tried to reference the id in MyVideoNav.xml but that didn't help...) but nothing changed. My guess is that the simple reason it won't show up is that the first list control already contains all of the list items.

I did manage to hide items depending on their 'ItemType' property, by typing:
Code:
<visible>StringCompare(ListItem.Property(ItemType), menu)</visible>
in the label control inside the ItemLayout. However, they were still there, just invisible.
Reply
#5
If you want so split your content over two lists, separate menu from movies, then you should to use two lists / panels. I don't think you can do that with a normal video plugin. So you'd have to make a script instead with it's own WindowXML. Here is an example:
https://github.com/divingmule/script.funnyordie

If you want different images per item type, say a mix of square thumbs and posters. Then you have to use two images in your layout.

Code:
<itemlayout>
    <control type="image">
        <texture></texture>
        <visible>!IsEmpty(ListItem.Property(ItemType))</visible>
    </control>
    <control type="image">
        <texture></texture>
        <visible>IsEmpty(ListItem.Property(ItemType))</visible>
    </control>
</itemlayout>
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#6
Ah, too bad. But it'll be fun learning to write scripts aswell. It was a great example you linked to; it didn't look as complicated as other scripts sometimes do. Just these classes that I feel I know nothing about, but I will have to do some studying Smile

Thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Treat ListItems differently in same folder0