How can you get html field in portal page widget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2024 06:54 AM
Currently I am able to get plain text fields in widgets. I need to get values entered in description field (HTML) to display in widgets and displayed value should be plain text format . How can I do it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2024 10:46 AM - edited ‎06-25-2024 10:50 AM
@Cindy Sim You have two options
1. You can use "$sp.stripHTML(YOUR_HTML_VALUE); " . This can be done on the server script of the widget.
2. you can use "$sce.trustAsHtml(YOUR_HTML_VALUE); ". This can be used on the client side script of the widget.
Please check the below screenshot for the uses of the above two with preview.
Mark this Helpful if it works for you.