Context menu item visibility
#1
I'm trying to build an addon that has 2 types of entries, one is playlist, the second is video and I would like to get 2 different context menus.
What I have at this moment is setting custom isPlaylist property in code
Code:
list_item.setProperty("isPlaylist", "true")

and in the in the addon.xml I have
Code:
<extension point="kodi.context.item">
        <menu id="kodi.core.main">
            <item library="contextMenu.py">
                <label>30003</label>
                <visible>ListItem.getProperty(isPlaylist)</visible>
            </item>
        </menu>
    </extension>

But the context menu is not shown.

I also tried with ListItem.isFolder, which works (The context menu item is shown), but I would like to use custom property for this.
Can anyone show me, what iam I doing wrong?
Reply
#2
usually do it like this:

Code:
<visible>IsEmpty(Container(55).ListItem.Property(isPlaylist))</visible>
Reply
#3
(2017-05-07, 18:58)gedisony Wrote: usually do it like this:

Code:
<visible>IsEmpty(Container(55).ListItem.Property(isPlaylist))</visible>

Thank you for your help, I ended up using

Code:
<visible>!IsEmpty(Container.ListItem.Property(isPlaylist))</visible>


it should do the trick until the next refactoring session.
Reply

Logout Mark Read Team Forum Stats Members Help
Context menu item visibility1