return variable back to parameter
#1
I'm trying to figure a way (or a way around) to pass a parameter back to a variable.

Simplification of what I am trying to do:

I have a label control in a container template:

PHP Code:
<param name="ID"/>
...
<
definition>
     <
label>$INFO[Container($PARAM[ID]).ListItem(0).Label]</label>
</
definition

So the include this is part of is reused several times and the container differs every time.

However, the above doesn't suffice. The label needs to have different info depending on a property set elsewhere.

So what I would like to do is:

PHP Code:
<label>$VAR[InfoLabel]</label

and get the value from the variable as in this example:

PHP Code:
<variable name="InfoLabel">
     <
value condition="StringCompare(Container(9000).ListItem.Property(widget),movies">$INFO[Container($PARAM[ID]).ListItem(0).Title]</value>
     <
value condition="StringCompare(Container(9000).ListItem.Property(widget),music">$INFO[Container($PARAM[ID]).ListItem(0).Artist]</value>    
     .. 

ID 9000 is a different container from the one that needs to display the info.

But this will not work. Probably because the variable is not "aware" of the parameters set.

Any ideas anyone? Hopefully the above is somewhat clearly explained.
Reply
#2
long shot (untested):
Code:
<param name="ID"/>
    <variable name="InfoLabel">
        <value condition="StringCompare(Container(9000).ListItem.Property(widget),movies">$INFO[Container($PARAM[ID]).ListItem(0).Title]</value>
        <value condition="StringCompare(Container(9000).ListItem.Property(widget),music">$INFO[Container($PARAM[ID]).ListItem(0).Artist]</value>
    </variable>

    <control type="label">
        <label>$VAR[InfoLabel]</label>
    </control>
</param>
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
Good idea, removed the first closing of the parameter but unfortunately I haven't been able to get it to work.
Reply

Logout Mark Read Team Forum Stats Members Help
return variable back to parameter0