Displaying HTML with Jelly in a UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2012 09:32 AM
So, I went into this project thinking this was going to be pretty straight forward. And, maybe it is. But what I thought should work intuitively isn't working as I anticipated and the information I'm finding online isn't working.
What I'm trying to do is display some HTML (on a UI Page) which is stored in a variable. Example...
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
var test = "<b>this is bold</b>";
</g:evaluate>
${test}
</j:jelly>
In case it's not clear, the desired outcome is to have a simple bold text "this is bold" display on the UI Page when visited. However, when you visit the page it looks like:
<b>this is bold</b>
Clearly the HTML is being encoded at some point in this whole thing and, despite searching forums and Google, I'm unsure how to fix it. Any ideas?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 07:21 AM
I am encountering the same issue in Helsinki.
Created a Widget displaying my UI page. Each of the methods below work to an extent, but whenever the refresh button on the widget is used, it shows the raw markup instead. Refreshing the whole dashboard or page resolves it, but does anyone know how to get the widget to refresh it properly?
I've used both of these methods, but get the same result:
<g2:no_escape>$[HTML:annAdv.u_html]</g2:no_escape>
<g2:no_escape>$[annAdv.u_html.getDisplayValue()]</g2:no_escape>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2016 05:19 AM
Hi Simon,
For me below code is working for Helsinki.
<g:no_escape>${HTML:current.text}</g:no_escape>
BR,
/Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2016 05:38 AM
I works for me as well, but only initially. I am using the code in a dashboard widget, and when the widget refreshes, it shows the raw code. Here are some screenshots to show what I am talking about:
Displayed, are two test entries to my widget. everything looks fine. There is even a hyperlink at the bottom of the 2nd one.
However, when I use the refresh button in the top right corner of the widget, it looks like this:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 07:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2019 10:40 AM
In case anyone has this issue, g2:no_escape does not work on catalog items. use g:no_escape instead