Hello there
My question is: Is there a way to add a clickable link to another webpage on a sitemap?
My first example would be a link to say WUnderground weather on my weather page in my sitemap. You know in case i want more information.
Another would be to have a shortcut to another sitemap that is more specialized for a scenario. (like the master sitemap have a link for other niche sitemaps)
Yet another would be to have a shortcut to my 3dprinter control webpage in my sitemap.
This would be nice to have. Is it possible?
Solution:
For any URL
String WUnderground_URL "<a href='https://www.wunderground.com'>Weather Underground</a>"
```
For local sitemaps
````java
String LINK_THERMOSTAT "<a href='/openhab.app?sitemap=thermostat'>Thermostat control</a>"
```
Well shoot. The last time I tried that I couldnât get a thing to work. Is this relatively new or did I just muck it up the last time I tired (probably the latter)?
I notice this info is missing from the sitemap wiki page.
Yeah, hmmm⊠not really sure how to add it in there to be honest. Right now Iâm not coming up with anything that doesnât look ham handed and out of place.
Thanks this works for sitemaps Does this work for any http://www.cats.com URL? or only sitemaps internally.
edit: so that was just some random url I made up⊠who knew it actually existed lol
edit2: If it does work for any URL, whatâs the syntax after href= ?
While this may work to provide the functionality youâre after, I canât help but see the fact you can inject html like that as a security vulnerability.
Do you mean as a user implementing it, or as the platform allowing linking to internal sitemaps?
Also when I add that code to my sitemap, Iâm getting this visual bug. The next two entries are covered by the same âurl linkâ as the text item. Rendering the lightswitch unaccessible
Is it, though? More to the point, in order to exploit this wouldnât you have to have write access to both $openhab/configurations/items and $openhab/configurations/sitemaps ? My thinking is that if you have write access to those directories, havenât you already lost the game?
@danielwalters86is correct. This could be exploited by an attacker who could modify the value of your URL Item, e.g through the REST API.
I think the likelihood of such an attack is low and assuming you have security enabled you already have bigger problems if an attacker can get to your api.
But given that the site map renders href, it does seem likely that one could exploit this for a cross site scripting attack, phishing, and drive by malicious software infection.
It is only by accident that you can embed working HTML tags in item labels, and it only works on browser clients. Ideally, there would be either a new widget type or hint so that URLs would be formally supported.