Kodi Community Forum

Full Version: Images not displaying when using Includes with Params
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi Everybody,

I have the following include which displays some movie posters in the home screen. I am using parameters to create several widgets of different menus.

For some reason, the Movie images appear only if the panel is focused. Does this not get evaluated because of the Paramter, if not focused? :<texture>$VAR[HomeWidget$PARAM[MenuNr].Image]</texture>

I know that the variable works, because the image is displayed when focus. But have no idea why it does not display when not focused. Any hints??


xml:

<include name="WidgetBody">            
    <control type="group">
        <include>WidgetSlideAnimation</include>
        <visible>String.IsEqual(Container(100).ListItem.Property(SelectedMainMenu),MainMenu$PARAM[MenuNr]) + !String.IsEmpty(Skin.String(HomeWidget$PARAM[MenuNr].Type)) + ![Skin.HasSetting(showNowPlayingOnHome) + [Player.HasAudio | Player.HasVideo]]</visible>
        <control type="panel" id="$PARAM[MenuNr]003">
            <left>380</left>
            <top>290</top>
            <width>880</width>
            <orientation>vertical</orientation>
            <itemlayout width="220" height="320">
                <control type="image">
                    <width>215</width>
                    <height>315</height>
                    <texture>$VAR[HomeWidget$PARAM[MenuNr].Image]</texture>
                    <aspectratio>scale</aspectratio>
                    <bordersize>5</bordersize>
                    <bordertexture>tile.png</bordertexture>
                </control>
                <control type="label">
                        <label>[COLOR Accent]$VAR[HomeWidget$PARAM[MenuNr].Label][/COLOR]</label>
                        <height>30</height>
                        <width>200</width>
                        <font>Panel_Hint</font>
                        <align>left</align>
                        <shadowcolor>black</shadowcolor>
                </control>
            </itemlayout>
            <focusedlayout width="220" height="320">
                <control type="image">
                    <width>215</width>
                    <height>315</height>
                    <texture>$VAR[HomeWidget$PARAM[MenuNr].Image]</texture>
                    <aspectratio>scale</aspectratio>
                    <bordersize>5</bordersize>
                    <bordertexture>button.png</bordertexture>
                </control>
                <control type="label">
                        <label>[COLOR Accent]$VAR[HomeWidget$PARAM[MenuNr].Label][/COLOR]</label>
                        <height>30</height>
                        <width>200</width>
                        <font>Panel_Hint</font>
                        <align>left</align>
                        <shadowcolor>black</shadowcolor>
                </control>
            </focusedlayout>
            <include content="WidgetPosterAndThumbContent">
                <param name="WidgetNr" value="$PARAM[MenuNr]"/>
            </include>
        </control>
    </control>
</include>

Here also a snippet of the variable in question:

xml:

<variable name="HomeWidget1.Image">
    <value condition="Skin.String(HomeWidget1.Type,RandomMovies)">$INFO[ListItem.Art(poster)]</value>
    <value condition="Skin.String(HomeWidget1.Type,RandomTvShows)">$INFO[ListItem.Art(poster)]</value>
    <value>default.png</value>
</variable>
Too early to fully understand your issue and my morning coffee is waiting for me, but I just noticed this:

<value condition="Skin.String(HomeWidget1.Type,RandomMovies)">$INFO[ListItem.Art(poster)]</value>

-->

<value condition="String.IsEqual(Skin.String(HomeWidget1.Type,RandomMovies))">$INFO[ListItem.Art(poster)]</value>
Hi Sualfred,

thanks for the hint.  You probably ment, but you were on the right track, it worked. Thanks a lot.

xml:

<value condition="String.IsEqual(Skin.String(HomeWidget1.Type),RandomTvShows)">$INFO[ListItem.Art(poster)]</value>


I actually have like 1000+ Variables using the original shown syntax, they all work fine, but it is definitely not the way to go, I will have some updating to do.
As I said, too early. The missing morning coffee placed the ) wrong Wink