I’m trying to get a custom icon into my Habpanel template widget.
I’ve trawled the forums and found a few different suggestions as to what worked for others. I’ve tried them all…I’ve added them all as a svg to my html/icons and icons/classic folders, tried dynamic links, static ones, referenced the icon directly…all to no avail.
So it’s a table row with 2 columns, that will repeat through all items in group gHPRoomMenu and list them in in the rows. The first column has the icon and the second just the item name as a link.
The ng-repeat works great, everything creates as it should but I get broken image link icons. I’ve debugged the image and get:
Which suggests that it can’t get the item.name…can someone please sense check this for me, maybe I’m just missing a quote mark or something but I’ve been on this for so long now I’ve gone code blind and don’t think I could see the answer if it was in bold and red!!!
Second, I’m trying to get the URL of the habpanel page I’m on, I can cast my mind back to the old days of coding JavaScript and I’ve tried to bring it up to habpanel based script, I’ve searched the forums and cobbled something together, and I’ve got:
var url_string = window.location.href; //window.location.href
or to get the last part of the URL string, (the bit I actually want)
var url_string = window.location.search.substring(1)
Now, it’s not working, (obviously otherwise I wouldn’t be posting this request), so I’m asking for help to knock it into shape to make it work please…
Awesome, that’s great thanks…now, can anyone tell me the best way to get thins into a template widget style code? Does it need an ng-init style coding to make it comparable or has anyone seem any similar code examples for me to learn off?
Basiclaly I want to get the last part of the URL, ie the current dashboard name and then compare it to a dummy item value I have in OH?