Where's the documentation for $VAR?
#1
See title.
Reply
#2
Added
http://wiki.xbmc.org/index.php?title=XBM...#Variables
Image [RELEASE] Metroid
Image [RELEASE] IrcChat
Reply
#3
Yay. Thanks for this - I was also in the dark as to how to use/implement $VAR. Very helpful!
Reply
#4
Thanks.

I've noticed that variables can't be declared in list items. It would be good if there was more info about where variables can be declared and how often they are updated. Maybe scope, precedence, persistence, naming rules and the other usual features that may be assumed to be packaged with something called a "variable".

After playing around I realise that what I need is a function...
Code:
<function name="Rainbow" param="input">
    <value  condition="Skin.String(input,'0'">red</value>
    <value  condition="Skin.String(input,'1'">green</value>
    <value>blue</value>
</variable>

<itemlayout>
   <texture>$FUNC[Rainbow, ListItem.Property(variable1)].png</texture>
</itemlayout>

#wishfulthinking
Reply
#5
(2013-12-20, 13:34)powlo Wrote: I've noticed that variables can't be declared in list items.

$VAR[] should work for listitems as well

eg:
Code:
<itemlayout>
   <texture>$VAR[thumb]</texture>
</itemlayout>

<variable name="thumb">
   <value condition="!IsEmpty(ListItem.Art(thumb))">$INFO[ListItem.Art(thumb)]</value>
   <value>$INFO[ListItem.Icon]</value>
</variable>
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
(2013-12-20, 15:18)ronie Wrote: $VAR[] should work for listitems as well

Ah You're right it does.

However I can only get it to work when it's declared in either includes.xml or outside the include that I actually want the variable to be used in.

Ie i have this:

Code:
<includes>
   <include name="myincludename">
       ... with the control list and reference to the $VAR[]
   </include>
   <variable name = ....>
      <value condition=..>...</value>
   </variable>

Defining it on the same level as itemlayout, as you suggest above, doesn't work.
Reply

Logout Mark Read Team Forum Stats Members Help
Where's the documentation for $VAR?0