Adding a custom tool to the Rich Text Editor to generate tokens

Sitecore provides you with multiple HTML editor profiles, and each provides different sorts of toolbar buttons. It also gives a provision to add a custom button to the editor toolbar and interact with a custom tool as well.

In the previous recipe, we used tokens to replace values of selected items. In this recipe, you will learn how to create a user interface to select items and fields, generate these token tags, and display them in better visuals in Design mode of the RTE.

Getting Ready

Just as a recap, in the previous recipe, we created tokens as shown in the following command. We will continue this recipe in reference to that:

<token field="Company" item="/sitecore/Content/Home/Global/Share ...

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.