---
title: Using the Rich text widget
related:
  - https://docs.kentico.com/13/managing-website-content/editing-rich-text-content/editing-content-in-rich-text-fields.md
  - https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-the-rich-text-editor-for-page-builder.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The **Rich text** widget is provided in Xperience by default. It allows content editors to add stylized text content to pages that use the [page builder](https://docs.kentico.com/13/managing-website-content/adding-page-content-using-widgets.md). The _Rich text_ widget can be found only when editing pages in the **Pages** application on the **Page** tab.

![Working with text in the Rich text widget](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/RTE_froala.png "Working with text in the Rich text widget")

The toolbar of the _Rich text_ widget is completely customizable with regards to its layout and functionality. It is possible that some functionality and buttons are not present in your project and the toolbar appearance is different than the screenshot on this page.

> **Tip:** **More editing options**
>
> The toolbar can be configured to include buttons that trigger an additional pop-up toolbar. Some functionality is therefore grouped under a single button. For example, subscript, superscript, text color, and other buttons are grouped under the **More text**![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/more_text_bttn.png) button in the default implementation of the toolbar. Look for icons containing the _More_![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/more_bttn.png) sign.

## Inserting dynamic text

You can add personalized text to the widget by using the \*\*Dynamic text![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/dynamic_bttn.png)\*\*button. The following types of dynamic text are available:

### URL parameter

This option allows you to customize the text based on the value of a URL parameter (the parameter must be present in the URL when the page is displayed).

1. Click on the \*\*Dynamic text![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/dynamic_bttn.png)\*\*button and select the \*\*URL parameter![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/url_bttn.png)\*\*tab.
2. Fill in the form:
   - **URL parameter** – the value of this parameter will be used in place of the dynamic text.
   - **Default text** – if the URL parameter is not provided, this text will be displayed.
3. Click **Insert**.

To see the result, navigate to the live site page and add a URL query string parameter to the URL of the page, for example: [www.example.com/some-page?greeting=Hello](http://www.example.com/some-page?greeting=Hello)

![Adding dynamic text based on a URL parameter](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/dyn_text.png "Adding dynamic text based on a URL parameter")

### Contact attribute

This option allows you to include a personalized piece of text based on information about the current contact.

1. Click on the \*\*Dynamic Text![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/dynamic_bttn.png)\*\*button and select the **Contact attribute**![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/cont_bttn.png) tab.
2. Fill in the form:
   - **Contact attribute** – select a contact attribute that will be displayed (such as the email address, names, etc.).
   - **Default text** – if the information about the current visitor is unknown, this text will be displayed instead.

![Adding dynamic text based on a contact attribute](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/contact_attr.png "Adding dynamic text based on a contact attribute")

## Inserting images

To insert images into the content of the widget, click the **Insert Image** ![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/image_bttn.png) button. You can select images from one of the following locations:

- **Media** – media files located in one of the site's [media libraries](https://docs.kentico.com/13/managing-website-content/working-with-files/media-library-files.md).
- **Attachments** – files [attached](https://docs.kentico.com/13/managing-website-content/working-with-files/page-attachments/attaching-files-to-pages.md) to the page.

Once an image is added to the content, you can select it and modify its properties. For example, you can add a link or set alternative text for the image.

![Modifying an inserted image](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/image_options.png "Modifying an inserted image")

> **Tip:** **Automatically generated image alternative text**
>
> Appropriate alternative text values for images in your content improve the website's accessibility and SEO capability. To help content editors set these values, you can ask your project administrators or developers to configure automatic generating of alternative text for images. This feature uses image recognition logic to provide alternative text in cases where it is not added manually.
>
> For technical information about the image recognition, see [Settings - Cognitive Services](https://docs.kentico.com/13/configuring-xperience/managing-sites/configuring-settings-for-sites/settings-content/settings-cognitive-services.md).

## Inserting links

To insert links into the content of the widget, click the **Insert Link**![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/link_bttn.png) button. You can either directly paste a URL to an external resource or you can click the **Select** button and use one of the following options:

- **Pages** – link to a page within the site's [content tree](https://docs.kentico.com/13/managing-website-content/working-with-pages.md).
- **Media** – link to a media file located in one of the site's [media libraries](https://docs.kentico.com/13/managing-website-content/working-with-files/media-library-files.md).
- **Attachments** – link to a file [attached](https://docs.kentico.com/13/managing-website-content/working-with-files/page-attachments/attaching-files-to-pages.md) to the page.

To remove the currently selected file or page from the selector, click the **Clear** button.

![Adding a link](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/insert_link.png "Adding a link")

### Example – Inserting links

Look at this short video to see how to link a page using the Rich text widget (demonstrated on our sample site):

🎬 [Video](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/kx13-adding-hyperlink-from-rich-text-widget-optim.mp4)

## Displaying HTML source code

You can view and edit the HTML code of the content displayed by the Rich text widget, by clicking the **Code View**![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/source_bttn.png) button. The code view button is located under the **More misc**![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/more_bttn.png) button in the default implementation of the toolbar. To close the code view, click the code view![](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/source_bttn.png) button on the right side of the widget.

Be aware that any erroneous changes will result in invalid HTML in the output of the widget.

![Editing the HTML source of the Rich text widget](https://docs.kentico.com/docsassets/13/using-the-rich-text-widget/source_mode.png "Editing the HTML source of the Rich text widget")

### HTML sanitization

The rich text editor sanitizes the content's HTML code, i.e., removes tags or attributes that can represent a security threat. This may in some cases modify or break your HTML code, for example when adding content via the editor's _Code View_ option.

To learn which HTML tags and attributes are allowed, see the default options described in [HtmlSanitizer](https://github.com/mganss/HtmlSanitizer). After applying [hotfix 13.0.92](https://devnet.kentico.com/download/hotfixes) or newer, the editor additionally allows ID and [data-\*](https://www.w3schools.com/tags/att_data-.asp) attributes.
