How to specify custom richtext menu as default richtext field setting when no source is specified for richtext field in sitecore

 Heythere! Welcome to "Sitecore Series"

Post is all about sharing the details about "Richtext field setting in templates and setting custom menu or adding a new menu as default setting to display a different menu in richtext editor"

While creating template fields, if the field type is richtext then we have an option to specify the setting item in the source. Based on the setting item, richtext menu will be displayed. 


image

Below are the different settings provided by sitecore:

1) /sitecore/system/Settings/Html Editor Profiles/Rich Text Full

2) /sitecore/system/Settings/Html Editor Profiles/Rich Text IDE

3) /sitecore/system/Settings/Html Editor Profiles/Rich Text Limited

4) /sitecore/system/Settings/Html Editor Profiles/Rich Text Medium

5) /sitecore/system/Settings/Html Editor Profiles/Rich Text Default


Based on the setting provided, richtext menu options will vary. If "Rich Text Full" setting is specified, richtext menu contains several options and if "Rich Text Limited" setting is specified very few options are available in the richtext menu.

If the setting item is blank, by default sitecore uses one default richtext setting item called "Rich Text Default" setting and displays the menu item accordingly.

What if we want our custom setting item to be displayed as default setting instead of sitecore provided default setting? or to display full menu as default?


Here is the solution:

Step 1: Grab the path of your custom richtext setting item path from core db.

Step 2: Create a patch file to update the setting value of "HtmlEditor.DefaultProfile" by specifying custom setting item path.



<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<setting name="HtmlEditor.DefaultProfile">
<patch:attribute name="value">/sitecore/system/Settings/Html Editor Profiles/custom setting name<patch:attribute>
</setting>
</sitecore>
<configuration>

That's it! your custom richtext setting menu will be displayed for all richtext fields when the setting is blank.


Hope this post helps you. Happy Sitecoring... 😊

Comments

Popular posts from this blog

Overwriting sxa content field in solr document

Displaying Custom 404 error page for urls with unallowed file extension in sitecore

How to rebuild custom solr index programmatically in Sitecore

Handling URL requests with different file extensions in Sitecore

Rendering Parameters and Rendering Parameter Templates in Sitecore

Accessing Items from Sitecore Database in different scenarios