2021-06-01, 20:50
I have 3 different widget types set up as includes that take in a bunch of params:-
Now in order for the user to select the different widget layouts I have a skin string that is set to one of the three widget types:-
I then define a nested include to encapsulate the correct widget like so:-
Then when I want to display the widget I just call "Widget" like so:-
This should take the skin string "WidgetAspect.1" pass it into the "Widget" include and add it on the nested include
Now the problem is if I pass in the text Landscape, Poster or Square the nested include works perfectly like so:-
But if I pass in $INFO[Skin.String(WidgetAspect.1)] nothing is displayed..... And to double check I've printed the value of $INFO[Skin.String(WidgetAspect.1)] as a label and it contains the correct text, Landscape Poster or Square.
I just can't figure it out, any help please.
xml:<!-- Landscape Widget -->
<include content="WidgetLandscape">
<param name="WidgetNumber" value="1" />
<param name="WidgetLabel" value="$INFO[Skin.String(WidgetName.1)]" />
<param name="ListID" value="9021" />
<param name="Content" value="$INFO[Skin.String(WidgetPath.1)]" />
<param name="ContentType" value="$INFO[Skin.String(WidgetTarget.1)]" />
<param name="SortBy" value="dateadded" />
<param name="SortOrder" value="descending" />
<param name="OnUp" value="9020" />
<param name="OnDown" value="9022" />
<param name="OnLeft" value="noop" />
<param name="OnRight" value="noop" />
<param name="OnBack" value="SetFocus(9021,0,absolute)" />
</include>
xml:<!-- Poster Widget -->
<include content="WidgetPoster">
<!-- EXACT SAME PARAMS AS LANDSCAPE -->
</include>
xml:<!-- Square Widget -->
<include content="WidgetSquare">
<!-- EXACT SAME PARAMS AS LANDSCAPE -->
</include>
Now in order for the user to select the different widget layouts I have a skin string that is set to one of the three widget types:-
Code:
Skin.SetString(WidgetAspect.1,Landscape) or
Skin.SetString(WidgetAspect.1,Poster) or
Skin.SetString(WidgetAspect.1,Square)
I then define a nested include to encapsulate the correct widget like so:-
xml:<include name="Widget">
<include content="Widget$PARAM[WidgetAspect]">
<param name="WidgetNumber" value="$PARAM[WidgetNumber]" />
<param name="WidgetLabel" value="$PARAM[WidgetLabel]" />
<param name="ListID" value="$PARAM[ListID]" />
<param name="Content" value="$PARAM[Content]" />
<param name="ContentType" value="$PARAM[ContentType]" />
<param name="SortBy" value="$PARAM[SortBy]" />
<param name="SortOrder" value="$PARAM[SortOrder]" />
<param name="OnUp" value="$PARAM[OnUp]" />
<param name="OnDown" value="$PARAM[OnDown]" />
<param name="OnLeft" value="$PARAM[OnLeft]" />
<param name="OnRight" value="$PARAM[OnRight]" />
<param name="OnBack" value="$PARAM[OnBack]" />
</include>
</include>
Then when I want to display the widget I just call "Widget" like so:-
xml:<!-- Widget 1 -->
<include content="Widget">
<param name="WidgetNumber" value="1" />
<param name="WidgetAspect" value="$INFO[Skin.String(WidgetAspect.1)]" />
<param name="WidgetLabel" value="$INFO[Skin.String(WidgetName.1)]" />
<param name="ListID" value="9021" />
<param name="Content" value="$INFO[Skin.String(WidgetPath.1)]" />
<param name="ContentType" value="$INFO[Skin.String(WidgetTarget.1)]" />
<param name="SortBy" value="dateadded" />
<param name="SortOrder" value="descending" />
<param name="OnUp" value="9020" />
<param name="OnDown" value="9022" />
<param name="OnLeft" value="noop" />
<param name="OnRight" value="noop" />
<param name="OnBack" value="SetFocus(9021,0,absolute)" />
</include>
This should take the skin string "WidgetAspect.1" pass it into the "Widget" include and add it on the nested include
Code:
<include content="Widget$PARAM[WidgetAspect]">
Now the problem is if I pass in the text Landscape, Poster or Square the nested include works perfectly like so:-
xml:<!-- Widget 1 -->
<include content="Widget">
<param name="WidgetNumber" value="1" />
<param name="WidgetAspect" value="Landscape" /> or Poster or Square - all work perfectly
<param name="WidgetLabel" value="$INFO[Skin.String(WidgetName.1)]" />
<param name="ListID" value="9021" />
<param name="Content" value="$INFO[Skin.String(WidgetPath.1)]" />
<param name="ContentType" value="$INFO[Skin.String(WidgetTarget.1)]" />
<param name="SortBy" value="dateadded" />
<param name="SortOrder" value="descending" />
<param name="OnUp" value="9020" />
<param name="OnDown" value="9022" />
<param name="OnLeft" value="noop" />
<param name="OnRight" value="noop" />
<param name="OnBack" value="SetFocus(9021,0,absolute)" />
</include>
But if I pass in $INFO[Skin.String(WidgetAspect.1)] nothing is displayed..... And to double check I've printed the value of $INFO[Skin.String(WidgetAspect.1)] as a label and it contains the correct text, Landscape Poster or Square.
I just can't figure it out, any help please.