Customizing built in rich text widget

2025/05/16 2:58 PM

I want to add properties to the rich text editor to allow for additional customization by the content editors. How do I add properties and reflect those properties in the view for the built in Kentico.RichText widget?


Environment

  • Xperience by Kentico version: [30.3.1]

  • .NET version: [8]

  • Execution environment: [SaaS|Private cloud (Azure/AWS/Virtual machine)]

  • Link to relevant Xperience by Kentico documentation

Tags:
Page Builder

Answers

2025/05/16 4:15 PM

All the details are in the docs

If you are having trouble finding something in the documentation, use the AI chat widget in the bottom right corner of the docs pages. Ask it a question about a topic and it will like to the sources of information it provides.

2025/05/16 4:18 PM

Thanks Sean. I have read through the docs, and spoken with AI, and nothing indicates that we might be able to create custom properties for the rich text widget. I was hoping someone here might have some other insight.

2025/05/16 5:51 PM

Maybe I'm misunderstanding what you mean when you write "custom properties". Can you link to something in the Froala docs or examples that show how you see custom properties working?

2025/05/16 6:09 PM

Widgets can have properties so the content editor can configure them. I want to give the rich text widget some custom widget properties so the editors can make adjustments that will be reflected in the rich text editor view when it outputs the content.

2025/05/16 6:20 PM

Ahh!

You want to extend the existing Rich Text widget! That is possible and you can follow the docs on extending a widget.

For example, if you wanted to wrap the rich text widget in some specific design or layout you can adjust the rendering of the view file for your extended widget and then render the existing widget inside your new markup.

The extended widget can have as many custom properties as you want and you aren't limited to just supplying a custom properties class and a view - you can use a full view component. Just take a look at the FallbackFormWidget in the Kentico Community Portal.

2025/05/16 6:59 PM

But with this method, I am still creating a new widget which would result in 2 rich text widgets. One with extended properties, one without. I want to extend or override the existing one, so I only have one rich text widget in existence.

2025/05/16 7:09 PM

There is no way to add properties to the built-in widgets (or any widget provided through a NuGet package) without extending them to create a new widget.

My recommendation is to extend the built-in rich text widget and apply widget redirections to your <editable-area> or <widget-zone> tag helpers to exclude the built-in one.

Widget and section restrictions are a good practice anyway and they are easier to adopt at the beginning of a project than later on when marketers have used all kinds of combinations of widgets and sections across the various pages.

2025/05/16 9:47 PM

There is a way, just not as much an 'official' way.

Here's me answering my own question:

How do you Alter Default Rich Text Editor Froala Configuration? | Kentico Community

Now you'll have to find some way to get your properties into the view, but this will allow you to alter the default rich text widget.

To answer this question, you have to login first.