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:
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important