2015-12-04, 21:30
(2015-12-04, 09:33)Jeroen Wrote: So I have been making some progress, thank you all for the help. I have my "normal" widgets actually showing up, even that feels like an achievement
I am still quite in the dark about how I can actually use
<content target="$SKINSHORTCUTS[target]">$SKINSHORTCUTS[path]</content>
for the regular widgets
and somehow substitute the path here for a regular include containing the static list content.
I have been switching back and forth between some of the methods posted here but it is quite overwhelming, I feel like I'm missing something totally obvious here.
I tried using an conditional include before the content tag and loads more but I'm afraid this is going to keep me busy for a while!
I had a similar issue when using static vs dynamic content way back with V2 of my widgets.
The issue is to do with how you define the content in the container, static vs dynamic.
This will work fine for dynamic content
Code:
<!-- Now insert the properties we pulled from the main menu -->
<content target="$SKINSHORTCUTS[target]">$SKINSHORTCUTS[path]</content>
But for Static content such as the weather widget you need to code it like this in place of the previous. Where path is the name of your include.
Code:
<!-- Now insert the properties we pulled from the main menu -->
<content>
<include>$SKINSHORTCUTS[path]</include>
</content>
And as Bob Mentioned your include (make sure not to use <content> tag in this)
Code:
<include name="weather-widget">
<item>
<onclick>noop</onclick>
<label>Now</label>
<label2>$INFO[Window(Weather).Property(Current.Temperature)]$INFO[System.TemperatureUnits] ($INFO[Window(Weather).Property(Current.FeelsLike)]$INFO[System.TemperatureUnits])</label2>
<icon>$VAR[weatherIcons]$INFO[Window(Weather).Property(Current.OutlookIcon)]</icon>
<property name="weatherFanart">$INFO[Window(Weather).Property(Current.FanartCode)]</property>
</item>
<item>
...
</item>
<item>
...
</item>
</include>
This should work if you make sure the path is set to the name of your weather widget includes in your overrides.
Code:
<widget label="Weather Forecast" type="custom" path="weather-widget">WeatherWidget</widget>
Code:
<shortcut label="Weather Forecast" widgetType="custom">weather-widget</shortcut>
You then could have two other includes such as <other include="widgetDynamic"> and <other include="widgetStatic"> in your templates. Then put some conditions in based on the widget type.
for static content
Code:
<condition tag="property" attribute="name|widgetType">custom</condition>
and for dynamic content
Code:
<condition tag="property" attribute="name|widgetType">otherwidgetType1</condition>
<condition tag="property" attribute="name|widgetType">otherwidgetType2</condition>
<condition tag="property" attribute="name|widgetType">otherwidgetType3</condition>
<match>any</match>