IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
The HTML field enables you and your users to create rich text content in a simple way via tools for creating, editing and formatting text, paragraphs, lists, images, tables, hyperlinks, and other HTML elements. The HTML field allows for flexible widget designer implementation that reflect various requirements of the UI of the widget designer, for example, having a long text field validation or adding image selectors.
The Content block widget uses the Kendo UI editor, which enables you to specify which tools are available in the editor toolbar. The Content block widget leverages this functionality and sets a predefined list of tools. The following article explains how to extend the default sf-html-field field and add extra logic that enables users to copy formatted text and paste it in the HTML field (editor) as plain text in the widget designer of a Content block widget. To do this, you override the following files:
By overriding the default view and the JavaScript file, you modify the paste functionality of the Kendo UI rich-text editor. As a result, the Paste event of the Kendo UI editor is registered. For more information about the event, see the Kendo UI documentation.
Since you are extending the sf-html-field used in the widget designer, you ensure consistency between different packages and between pages, both hybrid and MVC-only – the rich text editor of this widget will look and behave identically and globally.
Depending on what types of templates you are using and whether you are working with resource packages, you can get the default HTML field files in different GitHub locations. The following table provides you with a summary of what default file to use and where to create the new custom designer view and JavaScript files:
To override the default sf-html-field, do the following:
To override the default JavaScript file, do the following:
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important