How to access label and icon from custom video node XML?
#1
Question 
I'm using custom video nodes and I can see their label and icon in list in video view, but how can I access them later when i go to inside node?
My goal is to show in header of container real parent node name (like Documentaries, Anime or whatever user filled in his custom nodes XML) instead of default TV Shows. I was looking for something like Container.ParentNodeName and/or Container.NodeName but there is nothing like that. There are Container.FolderPath which show library URL containing smart playlist definition (not usable for me) and Container.FolderName which contains Titles/Genres/Years etc string.
Did I overlooked something or it isn't possible to get these informations? Or is there some other trick to do what I want?
Reply
#2
How are you creating the content for the list with your custom nodes? If you are using <item> inside <content> then just add an <onclick> condition to the item that sets a window property and call that
Code:
<onclick>SetProperty(nodelabel,LABELINFO,home)</onclick>

Code:
<label>$INFO[Window(home).Property(nodelabel)]</label>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
Content is created by XBMC itself. When you call

Code:
<onclick>ActivateWindow(Videos,root)</onclick>

you will get your custom structure or default one from system/library in XBMC install directory (more details on Wiki). In this view I can somehow manage setting properties because list contains real label from nodes XMLs (for example user can change "TV Shows" to "My TV Shows" in XML), but when I want to directly call my Anime node from Home

Code:
<onclick>SetProperty(nodelabel,Anime,home)</onclick>
<onclick>ActivateWindow(Videos,library://video/anime/titles.xml,return)</onclick>

I must hardcode it (or let user fill it in settings etc.) because I have no idea how to get it inside MyVideoNav.
Reply
#4
Ah I didn't even know that you could do that.

You could create a hidden button in all your view types focusedlayout that sets the property. Its pretty hacky but it should work - I tested it for the root dir for tvshows library and it worked. You would need to have all the container.content types in the onfocus condition (e.g. !Container.Content(movies) + !Container.Content(genres) + !Container.Content(sets) etc.)

Code:
<control type="button">
    <visible allowhiddenfocus="true">false</visible>
    <onfocus condition="!Container.Content(tvshows)">SetProperty(nodelabel,$INFO[ListItem.Label],home)</onfocus>
</control>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#5
For video root I plan to do it somehow similar to your proposal. But it still doesn't solve problem with direct links from Home, there will be necessary to have node label stored as skin setting and allow user to change it. Anyway it still can lead to inconsistency in case when user change node label in XML (visible in video root) and forgot to change it in skin (visible in direct links from Home) and vice versa.
Guess I'll make Feature request for some better skin support for custom video nodes.
Reply
#6
Instead of dealing with Nodes you could use Smartplaylists, and build a custom window to adress the defaultNodes + your Skinintern Smartplaylists.
(Just an Idea)

mfG.
Reply
#7
Yeah, I can use smartplaylist too (afaik custom nodes are backed up by smartplaylists) or hardcode everything for myself. But for publishing of my skin mod I wanted to support this XBMC feature because I personally use it. Method outlined by jurialmunkey will most likely work with some effort so I'll go this way for now. And tomorrow I'll create feature request for some better support for future versions.
Reply
#8
can't you just use <onclick>SetProperty(nodelabel,$INFO[ListItem.Label],home)</onclick> from the home menu. Surely the home menu item will be named the same as the node it goes to?
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#9
There are more possible ways how to make it somehow working, but all of them are kind of hack and/or workaround. I was looking for clean solution but looks like it doesn't exist.
I'll do it somehow now and wait until/if my Feature request is done. Thanks for your help.
Reply

Logout Mark Read Team Forum Stats Members Help
How to access label and icon from custom video node XML?0