Unfortunately there is no link element for sitemaps. To create links, I integrated the autolinker of gregjacobs (https://github.com/gregjacobs/Autolinker.js) into my sitemaps.
Add a web element to the sitemap:
Webview url="/static/inject_autolinker.html"
If you use blocks, it must be in every single block. You should place it at the end, otherwise the headings are hidden.
inject_autolinker.html:
<!--
Place in the sitemap (in every block):
Webview url="/static/inject_autolinker.html"
-->
<head>
<style>
</style>
</head>
<body>
<script src="../static/autolinker/dist/Autolinker.js"></script>
<script type="text/javascript">
var contents = window.parent.document.body.getElementsByClassName("mdl-form__label");
var autolinker = new Autolinker( { newWindow: false, truncate: 25 } );
for (var i=0, max=contents.length; i < max; i++) {
var content = contents[i];
content.innerHTML = autolinker.link(content.innerHTML);
}
</script>
</body>
Nice solution. Thanks for posting. How well does it work through myopenhab.org to look to another sitemap? Do you have to use the myopnhab.org address or the kan address? Does it work in there phone apps too? I suspect not given how webviews in general don’t work in the Android app when not on the lan.
I made something similar where you can define titles and other parameters for links as well like [Title|url], yours should work with myopenhab too, autolinker is a huge script for the job though.