- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2019 11:35 AM
Hi,
We recently modified our Incident form description field to html. This is working well in the platform, however, our portal description now displays the html code when viewing the ticket form. The widget "ticket fields updated" only renders plain text. I'm not sure how to get the widget to display correctly. Any help or guidance is very much appreciated.
Solved! Go to Solution.
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2019 12:04 AM
It's not enough to modify the Server Script by including the name of HTML field ("u_description_2" in your case) in the list of displayed fields:
var fields = $sp.getFields(gr, 'number,state,short_description,u_description_2,sys_created_on,watch_list');
You have to modify the Body HTML Template of the widget by including the line like the following
<sp-html-content ng-switch-when="html" model="::field.value" />
near the line number 23.
The corresponding fragment of HTML code will look:
<dd class= "col-md-6 col-sm-12 col-xs-6 break-word"
ng-repeat-end ng-switch="field.type"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)">
<sp-html-content ng-switch-when="html" model="::field.value" />
<div ng-switch-when="glide_date_time" title="{{field.display_value}}">
<sn-time-ago timestamp="::field.value" />
</div>
<div ng-switch-default >{{field.display_value}}</div>
</dd>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2019 12:04 AM
It's not enough to modify the Server Script by including the name of HTML field ("u_description_2" in your case) in the list of displayed fields:
var fields = $sp.getFields(gr, 'number,state,short_description,u_description_2,sys_created_on,watch_list');
You have to modify the Body HTML Template of the widget by including the line like the following
<sp-html-content ng-switch-when="html" model="::field.value" />
near the line number 23.
The corresponding fragment of HTML code will look:
<dd class= "col-md-6 col-sm-12 col-xs-6 break-word"
ng-repeat-end ng-switch="field.type"
ng-if="field.value && (field.type != 'decimal' || field.type == 'decimal' && field.value != 0)">
<sp-html-content ng-switch-when="html" model="::field.value" />
<div ng-switch-when="glide_date_time" title="{{field.display_value}}">
<sn-time-ago timestamp="::field.value" />
</div>
<div ng-switch-default >{{field.display_value}}</div>
</dd>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2023 10:54 PM
Hi @Oleg, thanks for this solution. But when I implemented that, I see code tags are also getting added before and after the actual content. That means, html is getting rendered but it is not rendering that code tags. Can you tell if there is any way to render that also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2019 06:13 AM
Oleg,
That worked! Thank you so much for the assistance! Much appreciated.
Steve