Kodi Community Forum

Full Version: Problem using variable in skinning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,  I have a problem with the use of variables

I want to have the fanart of a container
Code:
<include name="HomeTest">
    <param name="visible">true</param>
    <param name="container_id"></param>        
    <definition>
    ...
    
         <texture background="true">INFO[Container($PARAM[container_id]).ListItem.art(fanart)]</texture>

    ...
    </definition>
</include>

I have the id container in a variable FanartTest
Code:
<variable name="FanartTest">        
    <value>5300</value>
</variable>

If i do this, it's doesn't work , i have no fanart
Code:
<include content="HomeKodroid">
    <param name="container_id">$VAR[FanartTest]</param>    
</include>    

But if i do this, it works fine
Code:
<include content="HomeKodroid">
    <param name="container_id">5300</param>    
</include>    
I don't understand the probleme, thanks to help me
Can't use skin variables as a value like that.

You need to do
Code:

<variable name="FanartTest">
<value>$INFO[Container(5300).ListItem.Art(fanart)]</value>
</variable>

[...]
<control type="image">
<texture>$VAR[FanartTest]</texture>
</control>

$INFO and $VAR evaluate at the same time, so you can't use one as part of the name of the other. To Kodi it looks like you are literally trying to ask for Container("$VAR[FanartTest]")

You can use $PARAM to replace values because $PARAM evaluates at window load with includes, whereas $INFO and $VAR evaluate after the window loads.
thank you very much , you save my skin :-)