[SOLVED] How to loop/iterate over LatestMovie.[1-10].Title?
#1
Hi guys,

I am back again with a question.
I found out about the LatestMovie.[1-10].Title Infolabel that, per my understanding retrieves the titles of the latest 10 movies.

I want to display a list of 5 recently added movies.
What confounds me is how to loop over the "array" (what does [1-10] really mean? is it an array or an object?)

Trying to grasp the concept of how you iterate...

Thanks in advance!
Reply
#2
PHP Code:
LatestMovie.1.Title
LatestMovie.2
.Title
LatestMovie.3
.Title
LatestMovie.4
.Title
LatestMovie.5
.Title 
Reply
#3
lol. O.K. so it's easier than I thought.

Your starter skin is fantastic Hitcher!
Reply
#4
So I have created a list control to list out the recently watched movies like so:

PHP Code:
<!-- Recently added. -->
    <
control type="fixedlist" id="937">
        <
description>recently watched movies</description>
        <
posx>297</posx>
        <
posy>200</posy>
        <
width>600</width>
        <
height>500</height>
        <
visible>true</visible>

        <
itemlayout width="600" height="500">
            <
control type="image">
                <
width>200</width>
                <
height>550</height>
                <
posx>20</posx>
                <
posy>40</posy>
                <
info>Window.Property(LatestMovie.1.Thumb)</info>
            </
control>
            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
info>Window.Property(LatestMovie.1.Title)</info>
                <
font>Small</font>
                <
textcolor>white</textcolor>
            </
control>
        </
itemlayout>

        <
focusedlayout width="600" height="500">
            <
control type="image">
                <
width>200</width>
                <
height>550</height>
                <
posx>20</posx>
                <
posy>40</posy>
                <
info>Window.Property(LatestMovie.1.Thumb)</info>
            </
control>
            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
info>Window.Property(LatestMovie.1.Title)</info>
                <
font>Small</font>
                <
textcolor>white</textcolor>
            </
control>
        </
focusedlayout>


        <
content>
            <
item id="9371">
                <
texture>$INFO[Window.Property(LatestMovie.5.Thumb)]</texture>
                <
label>$INFO[Window.Property(LatestMovie.5.Title)]</label>
            </
item>
            <
item id="9372">
                <
texture>$INFO[Window.Property(LatestMovie.4.Thumb)]</texture>
                <
label>$INFO[Window.Property(LatestMovie.4.Title)]</label>
            </
item>
            <
item id="9373">
                <
texture>$INFO[Window.Property(LatestMovie.3.Thumb)]</texture>
                <
label>$INFO[Window.Property(LatestMovie.3.Title)]</label>
            </
item>
            <
item id="9374">
                <
texture>$INFO[Window.Property(LatestMovie.2.Thumb)]</texture>
                <
label>$INFO[Window.Property(LatestMovie.2.Title)]</label>
            </
item>
        </
content>

    </
control

Nothing shows up.
If I take the <items> out of the list into their own label and image controls they work fine.
But I want a list so I can define a layout and avoid repeating the formatting directives.
Reply
#5
Following this, try this:

PHP Code:
<!-- Recently added. -->
    <
control type="fixedlist" id="937">
        <
description>recently watched movies</description>
        <
posx>297</posx>
        <
posy>200</posy>
        <
width>600</width>
        <
height>500</height>
        <
visible>true</visible>

        <
itemlayout width="600" height="500">
            <
control type="image">
                <
width>200</width>
                <
height>550</height>
                <
posx>20</posx>
                <
posy>40</posy>

                <
texture>$INFO[ListItem.Thumb]</texture>
            </
control>
            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
font>Small</font>
                <
textcolor>white</textcolor>

                <
label>$INFO[ListItem.Label]</label>
            </
control>
        </
itemlayout>

        <
focusedlayout width="600" height="500">
            <
control type="image">
                <
width>200</width>
                <
height>550</height>
                <
posx>20</posx>
                <
posy>40</posy>

                <
texture>$INFO[ListItem.Thumb]</texture>
            </
control>
            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
font>Small</font>
                <
textcolor>white</textcolor>

                <
label>$INFO[ListItem.Label]</label>
            </
control>
        </
focusedlayout>


        <
content>
            <
item id="9371">
                <
thumb>$INFO[Window.Property(LatestMovie.5.Thumb)]</thumb>
                <
label>$INFO[Window.Property(LatestMovie.5.Title)]</label>
            </
item>
            <
item id="9372">
                <
thumb>$INFO[Window.Property(LatestMovie.4.Thumb)]</thumb>
                <
label>$INFO[Window.Property(LatestMovie.4.Title)]</label>
            </
item>
            <
item id="9373">
                <
thumb>$INFO[Window.Property(LatestMovie.3.Thumb)]</thumb>
                <
label>$INFO[Window.Property(LatestMovie.3.Title)]</label>
            </
item>
            <
item id="9374">
                <
thumb>$INFO[Window.Property(LatestMovie.2.Thumb)]</thumb>
                <
label>$INFO[Window.Property(LatestMovie.2.Title)]</label>
            </
item>
        </
content>

    </
control
Image
Reply
#6
every item needs to have at least <onclick></onclick> defined.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#7
Thanks for the reply!

I tried your approach, but no dice...
I also tried removing all the <thumbs> <icons> and <info> tags from the <itemlayout>; effectively this:

PHP Code:
<!-- Recently added. -->
    <
control type="fixedlist" id="937">
        <
description>recently watched movies</description>
        <
posx>297</posx>
        <
posy>200</posy>
        <
width>600</width>
        <
height>500</height>
        <
visible>true</visible>

        <
itemlayout width="600" height="500">

            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
font>Small</font>
                <
textcolor>white</textcolor>
                <
info>ListItem.Label</info>
            </
control>
        </
itemlayout>

        <
focusedlayout width="600" height="500">

            <
control type="label">
                <
posx>20</posx>
                <
poxy>45</poxy>
                <
font>Small</font>
                <
textcolor>white</textcolor>
                <
info>ListItem.Label</info>
            </
control>
        </
focusedlayout>


        <
content>
            <
item id="9371">
                <
label>asdasd</label>
            </
item>

        </
content>

    </
control

Nothing shows up.
I am dumbfounded.

(2014-04-24, 21:53)ronie Wrote: every item needs to have at least <onclick></onclick> defined.

Yes, this was it!
I made the same mistake for the second time.

Can you please tell me, why <onclick> is a necessity for it to be even displayed?
Other tags show up just fine...
Reply
#8
Helpful links:
http://wiki.xbmc.org/?title=Static_List_Content
http://wiki.xbmc.org/?title=Wrap_List_Container
http://wiki.xbmc.org/index.php?title=XBM...ing_Manual


Edit: Refresh old tabs before posting reply...
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] How to loop/iterate over LatestMovie.[1-10].Title?0