Hi @drc43 ,
Apologies for the late reply but in case you are still looking for the answer to this.
You can achieve this by using the regular a href html tag but it's a bit of a two step process.
- Create the label including some hyperlinked tag.
- Use a couple of StringPairReplacers to ensure the labels/hyperlinks are correctly formatted after the HTMLReportGenerator.
The HTMLReportGenerator does some character encoding so you need to fix it with the StringPairReplacers. If you inspect the HTML after the HTMLReportGenerator, you'll notice your a href tag in the label isn't quite right so the easiest way to fix it up is using the StringPairReplacers to put the encoded characters back to the appropriate character(s).
HTMLReportGenerator (note the < > ' ' characters output as encoded characters < ' etc. ):
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
After StringPairReplacers
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
Result!
I've attached the workspace for your reference :)
Hope that helps!
Hi @drc43 ,
Apologies for the late reply but in case you are still looking for the answer to this.
You can achieve this by using the regular a href html tag but it's a bit of a two step process.
- Create the label including some hyperlinked tag.
- Use a couple of StringPairReplacers to ensure the labels/hyperlinks are correctly formatted after the HTMLReportGenerator.
The HTMLReportGenerator does some character encoding so you need to fix it with the StringPairReplacers. If you inspect the HTML after the HTMLReportGenerator, you'll notice your a href tag in the label isn't quite right so the easiest way to fix it up is using the StringPairReplacers to put the encoded characters back to the appropriate character(s).
HTMLReportGenerator (note the < > ' ' characters output as encoded characters < ' etc. ):
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
After StringPairReplacers
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
Result!
I've attached the workspace for your reference :)
Hope that helps!
Worth noting, if you are using this in an app that uses the data streaming service, you'll want to set target='_blank' in the tag so the link opens in a new tab! Otherwise, the user would have to re-run the app to see the map again.
Hi @drc43 ,
Apologies for the late reply but in case you are still looking for the answer to this.
You can achieve this by using the regular a href html tag but it's a bit of a two step process.
- Create the label including some hyperlinked tag.
- Use a couple of StringPairReplacers to ensure the labels/hyperlinks are correctly formatted after the HTMLReportGenerator.
The HTMLReportGenerator does some character encoding so you need to fix it with the StringPairReplacers. If you inspect the HTML after the HTMLReportGenerator, you'll notice your a href tag in the label isn't quite right so the easiest way to fix it up is using the StringPairReplacers to put the encoded characters back to the appropriate character(s).
HTMLReportGenerator (note the < > ' ' characters output as encoded characters < ' etc. ):
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
After StringPairReplacers
"popupContent":"<a href='https://www.safe.com' target='_blank'>CLICK HERE</a> to go to our website!"
Result!
I've attached the workspace for your reference :)
Hope that helps!
Thanks for this @chrisatsafe ! I was short one StringPairReplacer and that was messing things up.