Need some Skinning help to display an image based on the list item selected
#1
Question 
I am trying to display an image based on the genre of a movie. If the movie is "children Friendly" for instance, then have an image display on the screen.

I have an image now that will display "Trailer Available" above the cover art in the fan art screen, and that was fairly simple to do. But that is simply a yes/no to display if a trailer is available. The genre is a bit more complex, as it needs to be displayed based on one of a hundred different ones.

Any help is greatly appreciated!
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#2
if you create a 'genres' subfolder under the media folder and store your images there (one for each genre),
you should be able to display them using
Code:
<texture>$INFO[ListItem.Genre,genres/,.png]</texture>
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
#3
Ronnie, thank you! Much appreciated, and so friggin' simple!
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#4
Question 
Ok, I have tried all sorts of variations.....

Here is the one I came up with that I was sure to work:
PHP Code:
    <description>This Will Display an Genre image if the file exists in the media folder</description>        
        <
control type="multiimage">
            <
posx>105</posx>
            <
posy>350</posy>
            <
width>170</width>
            <
height>20</height>
            <
texture>$INFO[ListItem.Genre,genres/,.png]</texture>
        </
control

I do have a "family.png" in both the root media folder, as well as the skins media folder, just for good measure. I can not for the life of me get this to show up. is there an equivalent of "Contains" in the skinning language? I ask as 99% of movies have more than a single genre. Could it be looking for "children, family, action" and not making a match?

Any help is, as always, much appreciated!
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#5
why are you using a multiimage control?
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
#6
Ok, by that, I guess I am doing something wrong Smile

I copied that code from somewhere else, and am using it to display a "Trailer Available" image above the top of the dvd cover in the fanart view. I found the subtle difference between the very light gray, and very light blue "movie reel" next to the movie list hard to distinguish. Its a WAF thing Smile

Anyhow, I use it do display the image, if a trailer for the highlighted movie has a trailer available to watch. It works perfectly, as you can see in this screen capture:

Image

This is the code I am using to do this:

PHP Code:
        <control type="multiimage">
            <
posx>45</posx>
            <
posy>350</posy>
            <
width>170</width>
            <
height>20</height>
            <
imagepath fallback="special://skin/media/Trailer_Available.png" background="FALSE">$INFO[]</imagepath>
            <
visible>!IsEmpty(Listitem.trailer)</visible>
        </
control


Is there another way that I should be doing that? I know next to nothing about the Kodi skinning language, and have just tried and tested things to get them to work Smile
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#7
(2016-10-02, 06:58)JohnWPB Wrote: Ok, by that, I guess I am doing something wrong Smile

hehe, i prefer to provide (subtle) hints instead of spoon-feeding the entire code ;-)
the 'teach a man to fish' approach...

now, there's two type's of image controls in kodi:
- there's <control type="image"> which is used the display a single image, and needs a <texture> tag to provide the path to the image.
- and there's <control type="multiimage"> which is used to display a folder of images (it creates kind of a slideshow) and needs a <imagepath> tag to provide the path to the image folder.

you can use the first one, both for the genre icon and the trailer image.

(2016-10-02, 06:58)JohnWPB Wrote: Anyhow, I use it do display the image, if a trailer for the highlighted movie has a trailer available to watch. It works perfectly, as you can see in this screen capture:

Image

you know, i actually like that a lot :-)
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
#8
(2016-10-02, 15:40)ronie Wrote: you know, i actually like that a lot :-)

We must think alike.... I like to think that I was partly responsible for the Transparency! skin in a small way. Way back I came up with the code to show the DVD/Blue Ray box cover behind the poster, with the glass looking overlay in the Confluence skin, You saw that, implemented it, and then after getting the taste for skinning, designed this amazing skin. One that after trying for the first time, I have used ever since. I have included a modifications of my own here and there though Smile

The weekend and my free time are just about gone for another week, and I am no closer to getting this working. Here is what I could put together from everything in this thread so far:

PHP Code:
    <description>This Will NOT Display an Genre image from the media/genre folder</description>    
        <
control type="image">
            <
posx>50</posx>
            <
posy>50</posy>
            <
width>100</width>
            <
height>100</height>
            <
texture>$INFO[ListItem.Genre,genres/,.png]</texture>
        </
control

Unfortunately, it does not work. I still think there must be an array variable for the genre, as 99% of the time there are more than one genre. I even edited a couple movies, removed them from the library and rescanned them back in with a SINGLE genre, and the above code will not display an image.
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#9
a few more "(subtle) hints " would be greatly appreciated Smile I have pretty much burned through this weekend trying other variations with no success yet.
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply
#10
When trying to bug fix these kind of things myself I will display a label somewhere that contains the strings I'm using. So in your case try replacing or adding $INFO[ListItem.Genre] to the $INFO[ListItem.Label] control.
Reply
#11
(2016-10-02, 17:51)JohnWPB Wrote: I still think there must be an array variable for the genre, as 99% of the time there are more than one genre. I even edited a couple movies, removed them from the library and rescanned them back in with a SINGLE genre, and the above code will not display an image.

yeah, for movies with multiple genres, this can/will never work i'm afraid.

as hitcher suggested, add a label control somewhere with <label>$INFO[ListItem.Genre,genres/,.png]</label> and check what value it returns.
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
#12
The label idea is a good one, thank you!

I do have one movie for testing with just a single genre, and still no image is displayed.

Is there no array[x] (If genre[1] = "family) or "If contains ="x" logic available in the skinning language that could work around the multiple genres? There has to be a sting that contains the genre's individually I would think.... It would seem odd to read all the genre's from the XML into a single variable....
------------------------------------------
Intel Quad core 3.8 Ghz / Windows 11 Pro / 32 gigs RAM/ MCE Remote /20 Tb storage / Intel Iris 550 chip-set outputting 4k via HDMI to a 80" LED TV / just over 5,800 movies

Have you entered your 5 Movies? - Support themoviedb.org as THE best open source movie information site.
Reply

Logout Mark Read Team Forum Stats Members Help
Need some Skinning help to display an image based on the list item selected1