Dynamic Content for MyVideoNav.xml
#1
I have a button on my Home.xml that has
xml:
<onclick>ActivateWindow(Videos,videodb://movies/titles/)</onclick>
which opens up my movie library.

I'm assuming that the window that loads has
xml:
<content>videodb://movies/titles/</content>
somewhere but I can't seem to find it.

Ultimately, I'm looking to change the content tag to contain a variable so that I can change it more easily when certain buttons get focused. Example
xml:
<content>$VAR[movieContent]</content>

and then my variable:
xml:

    <variable name="movieContent">
        <value condition="Container(60102).HasFocus(2)">videodb://recentlyaddedmovies/</value>
        <value>videodb://movies/titles/</value>
    </variable>

This sort of works if I add a <content>$VAR[movieContent]</content> block inside my view, but it messes things up overall. Here is a stripped down version of what I'm talking about in my ViewsVideoLibrary.xml
xml:

<?xml version="1.0" encoding="UTF-8"?>
<includes>
    <include name="MyCustomView">
        <control type="grouplist">
            <control type="panel" id="601">
                <content>$VAR[movieContent]</content>
                <itemlayout width="183" height="260">
                    <control type="image">
                        <texture background="true">$VAR[PosterThumb]</texture>
                    </control>
                </itemlayout>
                <focusedlayout width="288" height="270">
                    <control type="image">
                        <texture background="true">$VAR[PosterThumb]</texture>
                    </control>
                </focusedlayout>
            </control>
        </control>
    </include>
</includes>

The posters show correctly in the main container, but the additional list items are messed up. When I change it from All Movies to Recently Added, the main image block changes to show the 25 most recently added movies but the corresponding information (Title, duration, year, etc.) still follow the information for all movies.

Example:
When ALL MOVIES is selected, the first movie is "21 Jump Street". If I change it to RECENTLY ADDED, the content changes to the 25 most recently added movies and the poster for the first item correctly displays the "Avengers: End Game" poster, but when I hover over it, the title, duration, year, etc. all still show the information for "21 Jump Street".

Is there a way for me to either change the content so that it can use a variable? Or can I get the $INFO[ListItem.Label], $INFO[ListItem.Year], etc. to use the information from the additional <content>$VAR[movieContent]</content> tag that I added in my ViewsVideoLibrary.xml?
Reply
#2
Couldn't you just have a different onclick in each of the buttons you mentioned would be focused?
Reply
#3
I was sort of able to accomplish what I was looking to do with Container.Update()

My problem now is that I have a list where I want to have a different action when each item is focused. 

Example: 
xml:

        <control type="list" id="999999">
            <onfocus>Container.Update($INFO[Container(999999).ListItem.Property(pathvar)])</onfocus>
            <viewtype label="535">list</viewtype>
            <orientation>horizontal</orientation>
            <movement>1</movement>
            <include>subHeaderLayout</include>
            <content>
                <item id="1">
                    <label>Item 1</label>
                    <property name="pathvar">videodb://movies/titles</property>
                </item>
                <item id="2">
                    <label>Item 2</label>
                    <property name="pathvar">videodb://recentlyaddedmovies</property>
                </item>
                <item id="3">
                    <label>Item 3</label>
                    <property name="pathvar">videodb://movies/genres</property>
                </item>
            </content>
        </control>

This sort of works in that I can move from Item 1 to Item 2, lose focus on the list id=999999 and then focus it again and it updates the content to Recently Added Movies.

What I would like to have happen is that when I move from Item 1 to Item 2 that the action happens...but there is no <onfocus> for each <item>. Is there a way to have an action performed when the focus changes within a list?

EDIT:
Figured that out with adding a hidden button on my focusedlayout that triggered that event thanks to @Hitcher from this thread: https://forum.kodi.tv/showthread.php?tid=288767
Reply
#4
Is there a way to have Container.Update() not add to the history of the screen? When I hit the back button it takes me through each time I used Container.Update and I would like it to ignore that.

In the documentation I see Container.Update(path,replace). Would the replace portion do that? If so, am I sending a true/false? Or something else?
Reply

Logout Mark Read Team Forum Stats Members Help
Dynamic Content for MyVideoNav.xml0