Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 15/umbraco-cms/.gitbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ redirects:
extending/packages/types-of-packages: extending/packages/README.md
reference/configuration/nucachesettings: reference/configuration/cache-settings.md
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/listview: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/collection.md
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/rte-styles: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/styles.md
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/rte-plugins: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/plugins.md
fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/rte-blocks: fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/blocks.md
10 changes: 10 additions & 0 deletions 15/umbraco-cms/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@
* [Backoffice](fundamentals/backoffice/README.md)
* [Property Editors](fundamentals/backoffice/property-editors/README.md)
* [Built-in Property Editors](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/README.md)
* [Rich Text Editor](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/README.md)
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/configuration.md)
* [Plugins](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/plugins.md)
* [Blocks](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/blocks.md)
* [Change Rich Text Editor UI](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor/change-rich-text-editor-ui.md)
* [Rich Text Editor TinyMce](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/README.md)
* [Configuration](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/configuration.md)
* [Styles](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/styles.md)
* [Plugins](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/plugins.md)
* [Blocks](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/rich-text-editor-tinymce/blocks.md)
* [Image Cropper](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/image-cropper.md)
* [Block Editors](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/README.md)
* [Block Grid](fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Rich Text Editor TinyMce

`Schema Alias: Umbraco.RichText`
`UI Alias: Umb.PropertyEditorUi.TinyMCE`

`Returns: HTML`

{% hint style="warning" %}
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.
{% endhint %}

The Rich Text Editor (RTE) is highly configurable and based on [TinyMCE](https://www.tinymce.com/). Depending on the configuration, it will give your content editors more flexibility when working with content that should be more than plain text.

{% hint style="info" %}
**Are you using custom configurations or plugins with TinyMCE?**

In Umbraco 11 the TinyMCE version supported has been upgraded from version 4 to version 6. You need to migrate to the latest version if you are using TinyMCE plugins or custom configuration.

If your site is upgraded from an older version, follow the migration guides below to upgrade the TinyMCE version as well.

* [Migrate from version 4 to version 5](https://www.tiny.cloud/docs/tinymce/5/migration-from-4x/)
* [Migrate from version 5 to version 6](https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/)
{% endhint %}

## [Configuration options](configuration.md)

Customize everything from toolbar options to editor size to where pasted images are saved.

## [Styles](styles.md)

Use CSS to define specific editor styles and add them as formatting options of the Rich Text Editor.

## [Blocks](blocks.md)

Use Blocks to define specific parts that can be added as part of the markup of the Rich Text Editor.

## [Plugins](plugins.md)

Extend the functionality of the Rich Text Editor with plugins.

## Data Type Definition Example

![Rich Text Editor - Data Type](images/rte-datatype-v10.png)

## Content Example

![Rich Text Editor - Content](images/rte-content-11.png)

## MVC View Example

### Without Modelsbuilder

```csharp
@{
if (Model.HasValue("richText")){
<p>@(Model.Value("richText"))</p>
}
}
```

### With Modelsbuilder

```csharp
@{
if (!string.IsNullOrEmpty(Model.RichText.ToString()))
{
<p>@Model.RichText</p>
}
}
```

## Add values programmatically

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](https://apidocs.umbraco.com/v15/csharp/api/Umbraco.Cms.Core.Services.ContentService.html).

{% hint style="info" %}
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.
{% endhint %}

```csharp
@using Umbraco.Cms.Core.Services;
@inject IContentService Services;
@{
// Get access to ContentService
var contentService = Services;

// Create a variable for the GUID of the page you want to update
var guid = Guid.Parse("32e60db4-1283-4caa-9645-f2153f9888ef");

// Get the page using the GUID you've defined
var content = contentService.GetById(guid); // ID of your page

// Create a variable for the desired value
var htmlValue = new HtmlString("Add some text <strong>here</strong>");

// Set the value of the property with alias 'richText'.
content.SetValue("richText", htmlValue);

// Save the change
contentService.Save(content);
}
```

Although the use of a GUID is preferable, you can also use the numeric ID to get the page:

```csharp
@{
// Get the page using it's id
var content = contentService.GetById(1234);
}
```

If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string.

{% hint style="warning" %}
The following example uses `IPublishedSnapshotAccessor` which is obsolete in Umbraco 15 and will be removed in a later version.
{% endhint %}

```csharp
@using Umbraco.Cms.Core.PublishedCache;
@inject IPublishedSnapshotAccessor _publishedSnapshotAccessor;
@{
// Set the value of the property with alias 'richText'
content.SetValue(Home.GetModelPropertyType(_publishedSnapshotAccessor, x => x.RichText).Alias, "Add some text <strong>here</strong>");
}
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Blocks in Rich Text Editor
# Blocks

{% hint style="warning" %}
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.
Expand Down Expand Up @@ -98,4 +98,4 @@ The following example shows a Partial View of a Block with `MyBlockType` as Cont

## Build a Custom Backoffice View

Building Custom Views for Block representations in Backoffice is the same for all Block Editors. [Read about building a Custom View for Blocks here](../block-editor/build-custom-view-for-blocks.md)
Building Custom Views for Block representations in Backoffice is the same for all Block Editors. [Read about building a Custom View for Blocks here](../../../../../tutorials/creating-custom-views-for-blocklist.md).
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Configuration

{% embed url="<https://www.youtube.com/watch?v=QRIWz9SotY4>" %}
Rich Text Editor default implementation
{% endembed %}

In this article, you will learn about different ways to configure the Rich Text Editor (RTE).

## Toolbar

You have full control over which options should be available on the RTE.

![Toolbar: All options enabled](images/toolbar-full-11.png)

In the example above, all 34 options have been enabled. These options include copy/paste buttons, font styles like bold and italics, bullet lists, and options to embed videos and insert images.

## Stylesheets

It is possible to define specific styles that can be used when editing content using the RTE. You can use as many of these styles with the RTE as you want.

The RTE styles are defined in CSS files which can be created in the **Settings** section. Read the [RTE Styles](styles.md) article to learn more about this feature.

## Dimensions

Define the `height` and `width` of the editor displayed in the Content section.

## Maximum size for inserted images

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.

## Mode

The Rich Text Editor comes in two different modes: Classic and Inline.

### Classic

The default mode which displays the toolbar at the top.

![RTE Mode: Classic](images/rte-mode-classic-11.png)

### Inline

In this mode, the toolbar is hidden and only shows up when content in the editor is highlighted.

![Rich Text Editor Inline mode](images/inline-mode-new.png)

## Blocks

Blocks can be added as elements in the Rich Text Editor. Configuration and rendering of Blocks are described in the [Blocks in Rich Text Editor](blocks.md) article.

## Overlay Size

Select the width of the link picker overlay. The overlay size comes in three sizes: Small, Medium, and Large.

## Hide Label

When this option is checked the label and description for the RTE property will be hidden.

## Ignore User Start Nodes

Some backoffice users might be restricted to specific parts of the Content tree. When the "Ignore User Start Nodes" option is checked, users can pick any piece of content, when adding internal links.

## Image Upload Folder

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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@
description: Information on how to work with TinyMCE plugins in the rich text editor.
---

# Rich Text Editor Plugins

## Overview
# Plugins

The Rich Text Editor (RTE) in Umbraco is based on the open source editor [TinyMCE](https://www.tiny.cloud/). TinyMCE is a highly customizable editor, and it is possible to extend the functionality of the editor by adding plugins.

TinyMCE comes with a lot of plugins out of the box, but it is also possible to create your own plugins. This article will show you how to add a custom plugin to the rich text editor.

### Open-Source Plugins
## Open-Source Plugins

TinyMCE has a lot of open-source plugins available. You can find a list of these plugins on the [TinyMCE website](https://www.tiny.cloud/docs/tinymce/6/plugins/#open-source-plugins).

### Premium Plugins
## Premium Plugins

TinyMCE also has a number of [premium plugins](https://www.tiny.cloud/docs/tinymce/6/plugins/#premium-plugins) available. These plugins are only available for [paid TinyMCE subscriptions](https://www.tiny.cloud/pricing/). They can be added to the rich text editor by [adding a bit of configuration](#adding-a-premium-plugin).

Expand Down Expand Up @@ -151,7 +149,7 @@ To add a premium plugin, you need to add the plugin name to the `plugins` array
Premium plugins require a subscription at [TinyMCE Cloud](https://www.tiny.cloud/). You can go there and sign up for a free trial. You will get a Cloud API key that you can use to try out the premium plugins.
{% endhint %}

1.**Declaring the plugin**
1. Declaring the plugin

Let us first add the [powerpaste](https://www.tiny.cloud/docs/tinymce/6/introduction-to-powerpaste/) plugin to the rich text editor. This plugin is a premium plugin that helps you paste content from Word documents and other sources. We will configure the plugin to allow local images and clean the HTML when pasting Word documents.

Expand Down Expand Up @@ -181,7 +179,7 @@ Let us first add the [powerpaste](https://www.tiny.cloud/docs/tinymce/6/introduc

{% endcode %}

2.**Creating the plugin.js file**
2. Creating the plugin.js file

The `plugin.js` file should contain the JavaScript code to load the cloud-hosted TinyMCE premium plugins bundle. You must replace `{Cloud API Key}` with your own Cloud API key.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Rich Text Editor Styles
# Styles

It is possible to define specific styles and fonts for the Rich Text Editor (RTE). Once you have defined the styles, and enabled them on the RTE Data Type, the styles can be accessed directly in the Content section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image is not rendering in the preview.

![Rich Text Editor Styles](../../built-in-property-editors/rich-text-editor/images/rte-styles.png)
![Rich Text Editor Styles](images/rte-styles.png)

## Creating RTE Styles

Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,61 @@
# Rich Text Editor
# Rich Text Editor Tiptap

`Alias: Umbraco.TinyMCE`
`Schema Alias: Umbraco.RichText`
`UI Alias: Umb.PropertyEditorUi.TipTap`

`Returns: HTML`

{% hint style="warning" %}
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.
{% endhint %}

The Rich Text Editor (RTE) is based on [tinymce](https://www.tinymce.com/) and is highly configurable. Depending on the configuration, it will give your content editors more flexibility when working with content that should be more than only plain text.

{% hint style="info" %}
**Are you using custom configuration or plugins with TinyMCE?**
In Umbraco 15, the Rich Text Editor has a new default property editor UI that introduces Tiptap as an alternative.

In Umbraco 11 the TinyMCE version supported has been upgraded from version 4 to version 6. You need to migrate to the latest version if you are using TinyMCE plugins or custom configuration.
You can continue to use the [TinyMCE UI for the Rich Text Editor](../rich-text-editor-tinymce/README.md). This UI will be removed in Umbraco 16.

If your site is upgraded from an older version, follow the migration guides below to upgrade the TinyMCE version as well.
**Current limitations**

* [Migrate from version 4 to version 5](https://www.tiny.cloud/docs/tinymce/5/migration-from-4x/)
* [Migrate from version 5 to version 6](https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/)
The Tiptap UI currently does not support using custom styles for your rich text.
{% endhint %}

The Rich Text Editor (RTE) Tiptap property editor is highly configurable and based on [Tiptap](https://tiptap.dev/). Depending on the configuration setup, it provides editors a lot of flexibility when working with content.

## [Configuration options](configuration.md)

Customize everything from toolbar options to editor size to where pasted images are saved.

## [Styles](rte-styles.md)

Use CSS to define specific editor styles and add them as formatting options of the Rich Text Editor.
## [Blocks](blocks.md)

## [Blocks](rte-blocks.md)
Use Blocks to define specific parts that can be added as part of the markup of the Rich Text Editor.

Use Blocks to define specific parts which can be added as part of the markup of the Rich Text Editor.

## [Plugins](rte-plugins.md)
## [Plugins](plugins.md)

Extend the functionality of the Rich Text Editor with plugins.

## Data Type Definition Example

![Rich Text Editor - Data Type](../../../../../../../10/umbraco-cms/fundamentals/backoffice/property-editors/built-in-property-editors/rich-text-editor/images/rte-datatype-v10.png)
![Rich Text Editor - Data Type](images/rte-tiptap-datatypedefinition.png)

## Content Example

![Rich Text Editor - Content](../../built-in-property-editors/rich-text-editor/images/rte-content-11.png)
![Rich Text Editor - Content Example](images/rte-tiptap-contentexample.png)

## MVC View Example

### Without Modelsbuilder
### With Modelsbuilder

```csharp
@{
if (Model.HasValue("richText")){
<p>@(Model.Value("richText"))</p>
if (!string.IsNullOrEmpty(Model.RichText.ToString()))
{
<p>@Model.RichText</p>
}
}
```

### With Modelsbuilder
### Without Modelsbuilder

```csharp
@{
if (!string.IsNullOrEmpty(Model.RichText.ToString()))
{
<p>@Model.RichText</p>
if (Model.HasValue("richText")){
<p>@(Model.Value("richText"))</p>
}
}
```
Expand Down Expand Up @@ -109,7 +101,11 @@ Although the use of a GUID is preferable, you can also use the numeric ID to get
}
```

If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string:
If Modelsbuilder is enabled you can get the alias of the desired property without using a magic string.

{% hint style="warning" %}
The following example uses `IPublishedSnapshotAccessor` which is obsolete in Umbraco 15 and will be removed in a later version.
{% endhint %}

```csharp
@using Umbraco.Cms.Core.PublishedCache;
Expand Down
Loading
Loading