Skip to content
Franco Mussopower pages
Desk with lamp and laptop
Photograph · Clint Patterson / Unsplash
Guide No.027
TutorialConfiguration · CSS · Liquid

Using the Rich Text Editor Control in Power Pages

The relatively new Rich Text Editor control in Dataverse / Dynamics 365 / Model Driven Apps is a very welcome addition, especially for Power Pages / portal projects that are heavy on content management.

Level
03CustomiseStage 3 of 4
Read
5 min
Includes
2 snippets · 8 figures
Written
Feb 2023

The relatively new Rich Text Editor control in Dataverse / Dynamics 365 / Model Driven Apps is a very welcome addition, especially for Power Pages / portal projects that are heavy on content management. Even just the basics like headings, bulleted lists, numbered lists and tables can be a real pain otherwise. In case you haven’t heard, these Rich Text Editor controls are now supported on both Basic Forms and Multistep forms 😎

Wait, what?.. there’s a rich text editor control?!
Yes and it can be applied to any text column… and is well supported in portal forms 🙌

Here’s a handy guide from Microsoft about how to add the control in your Model Driven App forms

How to add a Rich Text Editor for use on Power Pages forms

Once you’ve added the control on your model-driven form, open the Basic Form or Multistep form step that your text field lives on
Select the Metadata tab and click New

Portal Management app
Screenshot - adding a new Basic Form Metadata record in the Portal Management app
Fig. 01Adding a new Basic Form Metadata record in the Portal Management app

Set the Type to Attribute
Select the required column from the Attribute Logical Name drop-down
Set the Control Style drop-down to Code Component

Portal Management app
Screenshot of the Portal Management app - Basic Form Metadata record to output form field using code component. Callout states Note - you can't type directly into the Attribute Logical Name text field. Select your attribute in the drop-down to the right
Fig. 02The Portal Management app - Basic Form Metadata record to output form field using code component. Callout states Note - you can't type directly into the Attribu…

So how does the rich text content look on portal forms?

Good news – they look professional and native, phew!

What about in portal lists?

Actually it’s not plain sailing. There are some gotchas… We can include the fields in our lists BUT it’s the raw content that gets displayed, HTML tags and all

What about outputting with liquid?

We can output HTML easily enough using your favourite liquid skills; fetch xml, the entities object, etc.. but again there’s a gotcha to work around: the field’s output is wrapped in a div that contains inline styles, setting the font size and font family which are most likely to clash with the rest of the page.

DevTools
Screenshot of Rich Text Editor output on a portal page along with the source code in the browser developer tools. The output is unexpectedly wrapped in a div that contains inline styles that overwrite the portal CSS
Fig. 03Rich Text Editor output on a portal page along with the source code in the browser developer tools. The output is unexpectedly wrapped in a div that contains in…

Okay, what’s the catch? What’s not love?

Like with many rich text editors, users are free to format their content using familiar visual tools like font styles, headings, bold, italic, alignment, inserting hyperlinks, etc. And the tool generates HTML behind the scenes.
For us control freaks, it’s good to know that the editing and formatting options available in the visual editor can be restricted so that we don’t let users go crazy with colours and font choices that overrule our carefully crafted on-brand CSS.

Note – fear not, I’ll show you how to avoid this nightmare below but I couldn’t resist🤡

Power Pages
Screenshot of Guns n Roses' artist page on the Songify portal. Example of poor formatting coming from freeform styles applied in the Rich Text Editor control. Callout shape reads "Please don't allow this" laughter emoji
Fig. 04Guns n Roses' artist page on the Songify portal. Example of poor formatting coming from freeform styles applied in the Rich Text Editor control. Callout shape r…

Here’s a handy CSS snippet to cancel that out:

CSS
div[data-wrapper="true"] {
font-family: unset !important;
font-size: unset !important;
}

Tip: What does that CSS mean / do?

If  you haven’t used unset before, unset (in layman’s terms) allows us to cancel out a style property without setting it to something else. For example, I don’t have to specify which font and font size to apply to the rich text editor instead. Essentially I’m saying give it
!important is a way to combat specificity. CSS is all about specificity; from global styles to styles targeted to very specific combinations of ids, classes, etc., right down to inline styles applied using the HTML style attribute. The reason we need to use !important here is that inline styles trump the specificity of global styles in our style sheet, regardless of which selectors we choose. We should use this sparingly but this is a good use case in my opinion.

My configuration – prevent fugly content from sneaking into your beautifully styled portal

Here’s some configuration JSON. this will:

Basically, removing temptation to control font size, font colours, dodgy fonts, etc…

JSON
{
"defaultSupportedProps": {
"toolbar": [ { "items": [ 
    "CopyFormatting",
    "Bold",
    "Italic",
    "Underline",
    "BulletedList",
    "NumberedList",
    "Link",
    "Unlink",
    "Strike",
    "Undo",
    "Redo",
    "RemoveFormat",
    "Table"
    ] } ]
},
"showAsTabControl": true,
"showHtml": true,
"showFullScreenExpander": true
}

For where to add this config, see this guide on Microsoft Learn

Adding my JSON as a JavaScript web resource:

Power Pages
Screenshot showing creation of a JavaScript web resource in a dataverse solution store the configuration JSON for my Rich Text Editor control
Fig. 05Showing creation of a JavaScript web resource in a dataverse solution store the configuration JSON for my Rich Text Editor control

Here’s the control in place in the modern form designer:

Power Apps maker portal
Screenshot of the Rich Text Editor control applies to a multi-line text column in the modern form designer in make.powerapps.com
Fig. 06The Rich Text Editor control applies to a multi-line text column in the modern form designer in make.powerapps.com

Here’s the ‘after’, with the styles tamed and fitting in with my portal CSS:

Power Pages
Screenshot of Guns n Roses' artist page on the Songify portal with freeform styles avoided due to configuration of Rich Text Editor control
Fig. 07Guns n Roses' artist page on the Songify portal with freeform styles avoided due to configuration of Rich Text Editor control

For more information on the configurable options, click here:
https://docs.microsoft.com/en-us/powerapps/maker/model-driven-apps/rich-text-editor-control

Words of warning / sanity check

All the HTML tags responsible for the formatting count against the maximum character length allowed for the fields. This only dawned on my when a client complained they’d only typed 10 words and had exceeded the 500 character limit on the field. You may find you need to increase the maximum character count quite substantially for HTML vs plain text.

My (very short) wishlist

One limitation I was surprised about is the lack of predefined ‘Styles’ like we’d find in WordPress, Microsoft Word, etc. While I don’t want to give users / content editors free reign over my portal CSS, being able to select from Heading 1, Heading 2, Paragraph, etc. would’ve nice.

Go deeper · Power Pages Mastery

This guide is one technique. The course is the method.

The course covers this in Level 1 · Foundations: “Forms, lists, validation, deep linking”, alongside “Data modelling for external users”. A structured programme distilled from dozens of real portal launches — from messy stakeholder requirements to successful go-live.

  • 6 weeks
  • 3 levels
  • Live training + video lessons
Where this fits
  1. Level 1Foundations
    • Forms, lists, validation, deep linking
    • Data modelling for external users
  2. Level 2Extending the platform
  3. Level 3Advanced customisation
Francesco isn’t just a Power Pages expert — he’s also an exceptional educator. I wholeheartedly endorse this course as the ideal resource for anyone eager to accelerate their career in Power Pages.
Safwan Karim — Senior Consultant — Accelerate Tech

8 comments

  1. Jady Mulqueeney

    Thanks, great article, very helpful

  2. Mariusz

    I don’t see any blog, article, or post on how to enable breadcrumb in power pages. I see Microsoft don’t go into those details in any articles and just repeat steps from the power apps portal. Maybe I missed something,Can you please check where exactly you can find breadcrumb components in the power page ?I have checked many articles but I feel I miss the trick.

    https://learn.microsoft.com/en-us/power-apps/maker/portals/add-breadcrumb
    https://ulrikke.akerbak.com/2022/03/22/power-portal-breadcrumb-with-fontawesome-arrow/#comment-1059

    1. Franco MussoAuthor

      They should already be present in the page header as part of the web templates your template site uses. However not every template site includes breadcrumbs necessarily. Which site template are you using?

      1. Mariusz

        Yes, I see. There is a Web Template called “Breadcrumbs”. You can include it where you want using the Liquid statement {% include ‘Breadcrumbs’ %} so it wasn’t that complex. I have done it.

        I know to to implement left nav in power pages using Liquid templates
        https://www.youtube.com/watch?app=desktop&v=jpHGvMsKxtk

        Have you heard how to implement “Microsoft left navigation” in power pages ? This is a specific left nav like in MIcrosoft Office 365 with icons which users can collapse and uncollapse. Sometimes it is called “Burger menu”

        1. Franco MussoAuthor

          I’ve implemented similar in the past but with Bootstrap 5 on its way, I’d wait and use its off canvas component for that

  3. Paul H

    You mention wishing you could add formatting for headings. This is possible, you can enable basically any Ckeditor tool. The tool you refer to is simply called “Format”. You might want to combine that with adding “format_tags”: “p;h1;h2;h3;h4;h5;h6” to your JSON file to control which formats are available.

    1. Franco MussoAuthor

      Thanks for sharing, Paul 🙂

Leave a comment

Your email address won’t be published. Comments are moderated.

Consulting

Need a Power Pages build that editors love and brands survive?

I help teams design and build Power Pages sites with bespoke UX. Tell me about yours.

Search

Book a discovery call

30 minutes. Bring your trickiest Power Pages problem — I’ll tell you honestly whether I’m the right fit.