web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Displaying an entity f...
Power Pages
Answered

Displaying an entity form with embedded HTML

(0) ShareShare
ReportReport
Posted on by 95

I have a custom entity with a multi-line text field. I've installed this Rich Text Control solution to allow formatting in the field. This works great when I am viewing a record in the model app itself. When I try to view that field in my Portal, the HTML no longer renders.

 

Is there a way to configure the form I'm using in the Portal such that embedded HTML gets rendered, instead of rendering everything in plaintext?

Categories:
I have the same question (0)
  • OOlashyn Profile Picture
    3,498 Most Valuable Professional on at

    Hi @dpana ,

     

    As for now, Custom Components are not supported on the Portal. You will need to add some 3rd party library on the portal (like tiny editor or quill) to support your scenario. 

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @dpana ,

    Do you want to format a multiple line of text field to html text?

    I suggest you  load rich text editor on a blank element(just add CDN libraries in Web template source code), then use javascript to populate default multi line text field with content in rich text editor, when everything is tested well, hide the default input field with js or css.

    Web template code:

    <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
    <link rel="stylesheet" href="https://cdn.quilljs.com/1.3.6/quill.snow.css">
    
    <div class="container">
     <div class="row">
     <div class="col-md-12">
     {% entityform name: 'My Portal Contact Form' %}
     </div>
     </div>
     <div class="row">
     <div class="col-md-12">
     <p style="font-weight: bold">Description</p>
     <div id="editor"></div> 
     </div>
     </div>
    </div>
    
    <script>
     var editor = document.getElementById("editor");
     var options = {
     placeholder: 'Add your description ..',
     theme: 'snow',
     modules: {
     toolbar: [
     ['bold', 'italic'],
     ['link', 'blockquote', 'code-block', 'image'],
     [{
     list: 'ordered'
     }, {
     list: 'bullet'
     }]
     ]
     }
     };
     var qseditor = new Quill(editor, options);
    
     var content = editor.childNodes[0];
    
     content.addEventListener("mouseleave", function(){
     document.getElementById("description").value = this.innerHTML.replace(/<p[^>]*>/g, "").replace(/<\/?p[^>]*>/g, "\n");
     });
    
    </script>

    You can use it for your own entity form for test.

     

    Here's a similar issue for your reference:

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/382592/html-wysiwyg-editor-for-dynamics-365-portals/1019566#1019566

     

     

    Best regards,

  • Verified answer
    dpana Profile Picture
    95 on at

    To clarify the situation:

     

    * I want the people creating the records to fill out a piece of information in a rich text editor

    * When displaying the record in the portal, I want that piece of information to be rendered to match what the rich text editor displays

     

    What I ended up doing:

     

    * I am using this plugin to change the multiline text field in my model-driven app into a rich text editor: https://pcf.gallery/rich-text-control/

    * Instead of using an entity form to display all of the information for the record, I am using it to display certain pieces of data, and am displaying the specific piece of HTML-formatted content using Liquid tags:

     

     

    {{thisRecord.crfc2_studentdocreqs_relatedsupplement.crfc2_descriptionofrequireddocuments}}

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 64

#2
DP_Prabh Profile Picture

DP_Prabh 34

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 30 Most Valuable Professional

Last 30 days Overall leaderboard