Conditional logic in skins and passing values (1 Viewer)

BadMrFrosty

Portal Member
July 9, 2009
24
28
Prague
Home Country
Czech Republic Czech Republic
Hi all,

I want to pass a value from a plugin into the skin. Looking at some skins, it looks like variables are generally accessed using the #name syntax. Does anyone have any detailed info on the skope of these variables? Are they accessable skin wide? Do I have to set them in a particular way in the plugin to be accessable in the skin?

Are things like IF statements possible in skins? If so could someone give me a example?

In the skin I want to do something like:

if (#myvalue = "abc")
{
skin defines elements
}
else
{
skin defines different elements
}

Thank you muchly
 

ltfearme

Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    You can not do any IF,ELSE statements but you can make skin properties return a TRUE|FALSE value so you can control the visibility of a control e.g.

    <visible>string.equals(#test,abc)</visible>

    This will display the control if #test = abc

    There is also a string.contains function, but they can only be used in MediaPortal 1.1.0.

    All skin properties can be accessed skin wide. The skin or plugin can control if its visible or not.
     

    BadMrFrosty

    Portal Member
    July 9, 2009
    24
    28
    Prague
    Home Country
    Czech Republic Czech Republic
    Thanks, just what I needed to know :)

    Still having problems and its driving me nuts :(

    I set a property in my plugin code:

    GUIPropertyManager.SetProperty("#emulator_coverarttype", "dvd");

    If I output that in the skin like this I get the expected value displayed:

    <label>#emulator_coverarttype</label>

    but when I test the value:

    <control>
    <type>fadelabel</type>
    <description>My Emulators Title</description>
    <id>0</id>
    <posX>600</posX>
    <posY>13</posY>
    <width>350</width>
    <font>mediastream12c</font>
    <align>right</align>
    <visible>string.equals(#emulator_coverarttype,aaaaaaaaaaaaaabbbbbbbbbbb)</visible>
    <label>test matched</label>
    </control>

    It does not matter what I test the property against, the label is always shown. Help please!!!!!!!!

    Thanks
     

    ltfearme

    Community Plugin Dev
  • Premium Supporter
  • June 10, 2007
    6,751
    7,196
    Sydney
    Home Country
    Australia Australia
    Well, there always have been but it was only fixed for 1.1.0. So your out of luck :(
     

    rivera

    Retired Team Member
  • Premium Supporter
  • December 1, 2008
    237
    21
    Home Country
    Russian Federation Russian Federation
    Can anybody provide a full list of string functions available in skins ? :)
     

    Users who are viewing this thread

    Top Bottom