Hi!
I’m trying to adapt a weather widget i found on the “main UI examples thread” and would like to use my png icons.
but the icons won’t show up:
- component: oh-icon
config:
icon: =items.forecastCode_0.state + '_' + items.TagNacht.state
style:
height: 60px
margin-bottom: 0px
i have the icons in the icons\classic\
folder:
a_Nacht.png
a_Tag.png
b_Nacht.png
b_Tag.png
c_Nacht.png
c_Tag.png
etc.
forecastCode_0.state = c
TagNacht.state = Tag
so i assume that the config in the widget means icon: c_Tag
, right?
with the developer tools i can see that the browser is looking for the icon but doesn’t find it:
Failed to load resource: the server responded with a status of 404 (Not Found)
when i just use icon: =items.forecastCode_0.state
the browser finds the icons named
a.png
b.png
c.png
etc.
without problems.
so i rewrote the icon: line to shorter names:
- component: oh-icon
config:
icon: "=(items.TagNacht.state == 'Nacht') ? items.forecastCode_0.state + 'n' : items.forecastCode_0.state"
style:
height: 60px
margin-bottom: 0px
and these icons:
a.png
an.png
b.png
bn.png
c.png
cn.png
etc.
so in the and my widget works but i still don’t understand why the first approach failed.