Schema Alias: Umbraco.RichText
UI Alias: Umb.PropertyEditorUi.TipTap
Returns: HTML
In Umbraco 15, the Rich Text Editor has a new default property editor UI that introduces Tiptap as an alternative.
You can continue to use the TinyMCE UI for the Rich Text Editor. This UI will be removed in Umbraco 16.
Current limitations
The Tiptap UI currently does not support using custom styles for your rich text.
Resizing media images has not been implemented yet.
The Rich Text Editor (RTE) Tiptap property editor is highly configurable and based on Tiptap. Depending on the configuration setup, it provides editors a lot of flexibility when working with content.
Customize everything from toolbar options to editor size to where pasted images are saved.
Use Blocks to define specific parts that can be added as part of the markup of the Rich Text Editor.
Extend the functionality of the Rich Text Editor with extensions.
See the example below to see how a value can be added or changed programmatically. To update a value of a property editor you need the Content Service.
The example below demonstrates how to add values programmatically using a Razor view. However, this is used for illustrative purposes only and is not the recommended method for production environments.
Although the use of a GUID is preferable, you can also use the numeric ID to get the page:
If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string.
This article is a work in progress and may undergo further revisions, updates, or amendments. The information contained herein is subject to change without notice.
It is possible to insert Blocks into the markup of the Rich Text Editor. Block can be created directly inside the Rich Text editor when
You have defined the Block Type as part of the RTE Data Type, and
Enabled the Blocks Toolbar Option.
The Block List property editor is configured in the same way as any standard property editor, via the Data Types admin interface.
To set up your Block List Editor property, create a new Data Type and select Block List from the list of available property editors.
Then you will see the configuration options for a Block List as shown below.
The Data Type editor allows you to configure the following properties:
Available Blocks - Here you will define the Block Types to be available for use in the property. Read more on how to set up Block Types below.
Blocks Live editing mode - Enabling this will edit a Block directly to the Rich Text Editor, making changes appear as you type.
Block Types are Element Types that need to be created before you can start configuring them as Block Types. This can be done either directly from the property editor setup process, or you can set them up beforehand. If they are set beforehand then they need to be added to the Rich Text Editor afterward.
Once you add an Element Type as a Block Type on your Rich Text Editor Data Type you will have options to configure it further.
Each Block has a set of properties that are optional to configure. They are described below.
By configuring the properties in the group you can customize the experience for your editors when they work with blocks in the Content section.
Display Inline with text - When turned on the Block Element will be able to stay in line with text or other elements. If not the Block will stay on its own line.
Custom view - Overwrite the AngularJS view for the block presentation in the Content editor. Use this to make a more visual presentation of the block or even make your own editing experience by adding your own AngularJS controller to the view.
Custom stylesheet - Pick your own stylesheet to be used for this block in the Content editor. By adding a stylesheet the styling of this block will become scoped. Meaning that backoffice styles are no longer present for the view of this block.
Overlay editor size - Set the size for the Content editor overlay for editing this block.
It is possible to use two separate Element Types for your Block Types. It's required to have one for Content and optional to add one for Settings.
Content model - This presents the Element Type used as a model for the content section of this Block. This cannot be changed, but you can open the Element Type to perform edits or view the properties available. Useful when writing your Label.
Settings model - Add a Settings section to your Block based on a given Element Type. When picked you can open the Element Type or choose to remove the settings section again.
These properties refer to how the Block is presented in the Block catalog when editors choose which Blocks to use for their content.
Background color - Define a background color to be displayed beneath the icon or thumbnail. Eg. #424242
.
Icon Color - Change the color of the Element Type icon. Eg. #242424
.
Thumbnail - Pick an image or Scalable Vector Graphics (SVG) file to replace the icon of this Block in the catalog.
The thumbnails for the catalog are presented in the format of 16:10, and we recommend a resolution of 400px width and 250px height.
These properties are relevant when you work with custom views.
Force hide content editor - If you made a custom view that enables you to edit the content part of a block and you are using default editing mode (not inline) you might want to hide the content editor from the block editor overlay.
To render Blocks in the frontend, you must create Partial Views for each Block.
The Partial Views must be:
Named by the alias of the Element Type that is being used as the Content Model for the Block.
Placed in the folder Views/Partials/RichText/Components/
.
For example, if the Element Type alias of the Content Model is myBlockType
, a Partial View must be created at Views/Partials/RichText/Components/MyBlockType.cshtml
.
The Partial View will receive the model of Umbraco.Cms.Core.Models.Blocks.RichTextBlockItem
. This gives you the option to access properties of the Content and Settings Models of your Block, as illustrated in the following sample:
If you use ModelsBuilder, you can specify the Content Model (and optionally the Settings Model) in the Partial View model. This allows for type-safe access to the Block data.
The following example shows a Partial View of a Block with MyBlockType
as the Content Model and MyBlockSettingsType
as the Settings Model:
In this article you can learn about the different options you have for configuring the Rich Text Editor (RTE).
You have full control over which options should be available on the RTE.
In the example above, all 27 options have been enabled. These options include font styles like bold and italics, bullet lists, and options to embed videos and insert images.
You can customize the look of the toolbar:
Enhance the capabilities of the toolbar by enabling or disabling extensions.
Use the Toolbar designer to group together items and add additional rows if needed.
Define height
and width
of the editor displayed in the content section.
Define the maximum size for images added through the Rich Text Editor.
If inserted images are larger than the dimensions defined here, the images will be resized automatically.
Select the width of the link picker overlay. The overlay size comes in three sizes: Small, Medium, Large, and Full.
Images added through the RTE are by default added to the root of the Media library.
Sometimes you might want to add the images to a specific folder. This folder can be configured using the "Image Upload Folder" setting.
Some of the backoffice users might be restricted to a specific part of the content tree. When the "Ignore User Start Nodes" is checked, the users can pick any piece of content from the content tree, when adding internal links through the RTE.
Label - Define a label for the appearance of the Block in the editor. The label can use AngularJS template string syntax to display values of properties.
Building Custom Views for Block representations in Backoffice is the same for all Block Editors. .
Blocks can be added as elements in the Rich Text Editor. Configuration and rendering of Blocks are described in the article.
Information on how to work with Tiptap extensions in the rich text editor.
The Rich Text Editor (RTE) in Umbraco is based on the open-source editor Tiptap.
Out of the box, Tiptap has limited capabilities and everything is an extension by design. Basic text formatting features such as bold, italic, and underline are their own extensions. This offers great flexibility, making the rich text editor highly configurable. The implementation in Umbraco offers a wide range of built-in extensions to enhance the Tiptap editor capabilities.
Using the same extension points, this article will show you how to add a custom extension to the rich text editor.
Tiptap has a library of supported native extensions. You can find a list of these extensions on the Tiptap website. While many of these are open source, there are also pro extensions available for commercial subscriptions.
There are two types of extension: tiptapExtension
and tiptapToolbarExtension
.
The tiptapExtension
extension is used to register a native Tiptap Extension. These will enhance the capabilities of the rich text editor itself. For example, to enable text formatting, drag-and-drop functionality and spell-checking.
The tiptapToolbarExtension
extension adds a toolbar action that interacts with the Tiptap editor (and native Tiptap extensions).
This example assumes that you will be creating an Umbraco package using the Vite/Lit/TypeScript setup. You can learn how to do this Vite Package Setup article.
In this example, you will take the native Tiptap open-source extension Highlight. Then register it with the rich text editor and add a toolbar button to invoke the Task List action.
Install the Highlight extension from the npm registry.
Create the code to register the native Tiptap extensions in the rich text editor.
Create the toolbar action to invoke the Highlight extension.
Once you have the above code in place, they can be referenced in the package manifest file.
Upon restarting Umbraco, the new extension and toolbar action will be available in the Tiptap Data Type configuration settings.
Umbraco 15 includes two options for rich text editing: Tiptap and TinyMCE. TinyMCE will eventually be phased out of the CMS.
This article will guide you through switching from TinyMCE UI to the new Tiptap UI.
The following steps will guide you through changing the property editor used for rich text on an existing Document Type.
The first step in this guide is to create a new Rich Text Editor Data Type using the Tiptap property editor.
As an alternative, you can create a new Data Type using the Tiptap property editor when updating the Document Type.
When swapping the UI used for the Rich Text Editor, you may need to reconfigure the toolbar.
Navigate to the Settings section of the Umbraco Backoffice.
Select + next to the Data Types folder.
Select New Data Type....
Give the new Data Type a name.
Click Select a property editor.
Choose Rich Text Editor [Tiptap].
Configure the Data Type to match your needs.
Save the Data Type.
Once you have prepared the new Data Type you need to update the Document Types that should use it.
Expand the Document Types folder.
Select a Document Type that needs to be updated.
Click on the Property used for rich text.
Hover over the selected property editor and click Change.
Search for the newly created Data Type and select it.
Submit the changes.
Save the Document Type.
Repeat steps 2-7 for each Document Type that needs to use the new Data Type.
When you have updated all the relevant Document Types, it is recommended to verify the content that uses the Rich Text Editor.