Kodi Community Forum

Full Version: ?: Conditional Visibility
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Suppose that I use a fixedlist control to display content:
PHP Code:
<control type="fixedlist" id="200">
<
itemlayout>
</
itemlayout>

<
focusedlayout>
</
focusedlayout>

<
content>
     <
item id="0">
     </
item>

     <
item id="1">
     </
item>

     <
item id="2">
     </
item>
</
content>
</
control

how would i go about making an image visible only for item 1?

thanks in advance.
<visible>Container(200).HasFocus(1)</visible> unless your inside the list then its much harder and you need visible conditions based on ListItem.blah conditions
Jezz_X Wrote:<visible>Container(200).HasFocus(1)</visible> unless your inside the list then its much harder and you need visible conditions based on ListItem.blah conditions

I see... Indeed, the controls would be inside the list; well then, it can't be helped, I'll put that in the back burner for now...

Thanks!
Add something like <property name="image">1</property> only to your first item... then add <visible>!IsEmpty(ListItem.property(image))</visible> to the image control.
`Black Wrote:Add something like <property name="image">1</property> only to your first item... then add <visible>!IsEmpty(ListItem.property(image))</visible> to the image control.

Interesting tip.

I can't find more info about it in wiki, unless it's this:

Code:
Window([window]).Property(key)     Window property. (key can be any value, optional window can be id or name)

?
http://wiki.xbmc.org/index.php?title=Sta...st_Content

Although the bold tags make it a bit confusing -

Quote:<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>
<property name="key">Item 1, Property(key)</property>
<property name="key2">Item 1, Property(key2)</property>
</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>
<property name="key">Item 2, Property(key)</property>
<property name="key2">Item 2, Property(key2)</property>
</item>
</content>
Hitcher Wrote:http://wiki.xbmc.org/index.php?title=Sta...st_Content

Although the bold tags make it a bit confusing -
You can use
Code:
<content>
<item id="1">
[...]
<property name="key">SomeValueHere</property>
</item>
</content>
And then inside container You can use ListItem.Property(key) - it will be "SomeValueHere" (without quotation marks of course). If You find description in wiki confusing - feel free to update it Smile
That's how I've always used it but looking at that sample the Item 1, parts made it look more confusing than it is. If others understand then it fine.
Thanks for info.

I found wiki info confusing, too so I changed it.
pieh Wrote:You can use
Code:
<content>
<item id="1">
[...]
<property name="key">SomeValueHere</property>
</item>
</content>
And then inside container You can use ListItem.Property(key) - it will be "SomeValueHere" (without quotation marks of course). If You find description in wiki confusing - feel free to update it Smile

What the hell how long ago was that added :/ last I looked you could only set label label2 thumb and icon people really need to add announcements topics when things like this get added
I've used it for 6-8 months, Ronie gave me the answer so he used it longer than that
Jezz_X Wrote:What the hell how long ago was that added :/ last I looked you could only set label label2 thumb and icon people really need to add announcements topics when things like this get added

Seriously?

It's got to be a good year or more now.
Yep seriously so is it so old that it's even included in dharma builds?
Modified Sun Jan 17 05:24:12 2010 UTC (17 months ago) by jmarshallnz

added: Support for <property name="foo">value</property> in static list content. Ticket #6692.

Smile
Pages: 1 2