String compare using an includes $PARAM
#16
(2021-03-28, 15:20)Bumpaneer Wrote: Can you apply $PARAM[Widget] to a hidden button or label and then use that for the compare instead of the $PARAM directly?

Wow.... You're a genius, that worked perfectly Big Grin

Thank you
Reply
#17
(2021-03-28, 13:53)roidy Wrote: Ok, this is what I'm actually trying to do.

skinshortcuts I have a set of widgets defined

xml:
<widget-groupings>
    <!-- Embuary Helper Widgets -->
    <node label="$LOCALIZE[31496]" icon="DefaultFolder.png">
    <shortcut widget="embuaryhelpermoviesrandomgenre" label="$LOCALIZE[31497]" widgetType="movies" widgetTarget="video" condition="Library.HasContent(movies) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getbygenre&amp;unwatched=True&amp;type=movie&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    <shortcut widget="embuaryhelpertvshowsrandomgenre" label="$LOCALIZE[31498]" widgetType="tvshows" widgetTarget="video" condition="Library.HasContent(tvshows) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getbygenre&amp;unwatched=True&amp;type=tvshow&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    <shortcut widget="embuaryhelpernextepisodes" label="$LOCALIZE[31499]" widgetType="episodes" widgetTarget="video" condition="Library.HasContent(tvshows) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getnextup&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    </node>
</widget-groupings>

Then in my widget template code I extract the widget property and pass it to the include code that displays the widget like so:-

xml:
<other include="widgets">
    <property name="widget" tag="property" attribute="name|widget" />
    <property name="label" tag="property" attribute="name|widgetName" />
    <controls>
        <control type="group" id="16000">
            <skinshortcuts>visibility</skinshortcuts>
            <control type="group">
                <include content="HomeWidgetLandscape">
                    <param name="WidgetLabel" value="$SKINSHORTCUTS[label]" />
                    <param name="Widget" value="$SKINSHORTCUTS[widget]" />
                </include>
            </control>
        </control>
    </controls>
</other>

Now depending on the value of $PARAM[Widget] I need to choose which label to display in my Widget include:-

xml:
<include name="HomeWidgetLandscape">
    <param name="WidgetLabel" default="" />
    <param name="Widget" default="" />
    <definition>
        <control type="group">
            <!-- Default fallback label if widget isn't an Embuary Helper widget -->
            <control type="label">
                <visible>String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring))</visible>
                <label>$PARAM[WidgetLabel]</label>
            </control>
            <!-- Check $PARAM[Widget] to see which Embuary Helper widget it is -->
            <control type="label">
                <visible>!String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring)) + String.IsEqual($PARAM[Widget],embuaryhelpermoviesrandomgenre)</visible>
                <label>$INFO[Container($PARAM[ListID]).ListItem.Property(searchstring),$LOCALIZE[31500] , $LOCALIZE[31501]]</label>
            </control>
            <control type="label">
                <visible>!String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring)) + String.IsEqual($PARAM[Widget],embuaryhelpertvshowsrandomgenre)</visible>
                <label>$INFO[Container($PARAM[ListID]).ListItem.Property(searchstring),$LOCALIZE[31500] , $LOCALIZE[31502]]</label>
            </control>
        </control>
    </definition>
</include>

You see I have no Skin.String(foo) all I have is a text value in the includes $PARAM.

Thanks

ok.just a thought, as you use the fixed path anyway, and just differenciate between shows n movies, why just
dont use a variable visable condintion for the label.

sorry if i misunderstood.



like
xml:

[String.Contains(Container($PARAM[ListID]).Folderpath,getbygenre) + String.Contains(Container($PARAM[ListID]).Folderpath,type=tvshow)]
or
String.Contains(Container($PARAM[ListID]).Folderpath,getbygenre) + String.IsEqual(Container($PARAM[ListID]).dbtype,tvshow))
Skins |  Titan M O D   •   S W A N (WIP)
Reply
#18
(2021-03-28, 23:03)mardukL Wrote:
(2021-03-28, 13:53)roidy Wrote: Ok, this is what I'm actually trying to do.

skinshortcuts I have a set of widgets defined

xml:
<widget-groupings>
    <!-- Embuary Helper Widgets -->
    <node label="$LOCALIZE[31496]" icon="DefaultFolder.png">
    <shortcut widget="embuaryhelpermoviesrandomgenre" label="$LOCALIZE[31497]" widgetType="movies" widgetTarget="video" condition="Library.HasContent(movies) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getbygenre&amp;unwatched=True&amp;type=movie&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    <shortcut widget="embuaryhelpertvshowsrandomgenre" label="$LOCALIZE[31498]" widgetType="tvshows" widgetTarget="video" condition="Library.HasContent(tvshows) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getbygenre&amp;unwatched=True&amp;type=tvshow&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    <shortcut widget="embuaryhelpernextepisodes" label="$LOCALIZE[31499]" widgetType="episodes" widgetTarget="video" condition="Library.HasContent(tvshows) + System.HasAddon(script.embuary.helper)">plugin://script.embuary.helper/?info=getnextup&amp;reload=$INFO[Window(home).Property(EmbuaryWidgetUpdate)]</shortcut>
    </node>
</widget-groupings>

Then in my widget template code I extract the widget property and pass it to the include code that displays the widget like so:-

xml:
<other include="widgets">
    <property name="widget" tag="property" attribute="name|widget" />
    <property name="label" tag="property" attribute="name|widgetName" />
    <controls>
        <control type="group" id="16000">
            <skinshortcuts>visibility</skinshortcuts>
            <control type="group">
                <include content="HomeWidgetLandscape">
                    <param name="WidgetLabel" value="$SKINSHORTCUTS[label]" />
                    <param name="Widget" value="$SKINSHORTCUTS[widget]" />
                </include>
            </control>
        </control>
    </controls>
</other>

Now depending on the value of $PARAM[Widget] I need to choose which label to display in my Widget include:-

xml:
<include name="HomeWidgetLandscape">
    <param name="WidgetLabel" default="" />
    <param name="Widget" default="" />
    <definition>
        <control type="group">
            <!-- Default fallback label if widget isn't an Embuary Helper widget -->
            <control type="label">
                <visible>String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring))</visible>
                <label>$PARAM[WidgetLabel]</label>
            </control>
            <!-- Check $PARAM[Widget] to see which Embuary Helper widget it is -->
            <control type="label">
                <visible>!String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring)) + String.IsEqual($PARAM[Widget],embuaryhelpermoviesrandomgenre)</visible>
                <label>$INFO[Container($PARAM[ListID]).ListItem.Property(searchstring),$LOCALIZE[31500] , $LOCALIZE[31501]]</label>
            </control>
            <control type="label">
                <visible>!String.IsEmpty(Container($PARAM[ListID]).ListItem.Property(searchstring)) + String.IsEqual($PARAM[Widget],embuaryhelpertvshowsrandomgenre)</visible>
                <label>$INFO[Container($PARAM[ListID]).ListItem.Property(searchstring),$LOCALIZE[31500] , $LOCALIZE[31502]]</label>
            </control>
        </control>
    </definition>
</include>

You see I have no Skin.String(foo) all I have is a text value in the includes $PARAM.

Thanks

ok.just a thought, as you use the fixed path anyway, and just differenciate between shows n movies, why just
dont use a variable visable condintion for the label.

sorry if i misunderstood.



like
xml:

[String.Contains(Container($PARAM[ListID]).Folderpath,getbygenre) + String.Contains(Container($PARAM[ListID]).Folderpath,type=tvshow)]
or
String.Contains(Container($PARAM[ListID]).Folderpath,getbygenre) + String.IsEqual(Container($PARAM[ListID]).dbtype,tvshow))

I actually tried that but Container($PARAM[ListID]).Folderpath on an Embuary filled widget item doesn't return the plugin path it returns nothing.

Thanks anyway.
Reply

Logout Mark Read Team Forum Stats Members Help
String compare using an includes $PARAM0