How do I add a rich text editor to my own custom user contro

Posted by Community Admin on 03-Aug-2018 00:54

How do I add a rich text editor to my own custom user control?

All Replies

Posted by Community Admin on 03-Dec-2011 00:00

Can anyone point me to the blog post / documentation / external blog post that explains how to add the Sitefinity rich text editor to my own custom user control? I've built a few user controls for Sitefinity now, so I'm familiar with the javascripts and ascx files needed, but until now, I haven't needed to add a rich text box field to my own control. (because for most rich text needs the content block works fine)

I've included a screenshot to show what I'm referring to. Thanks!

Posted by Community Admin on 03-Dec-2011 00:00

Dan,

This blog post may be helpful to you. It has examples too! :)

Hope that helps!

Posted by Community Admin on 05-Dec-2011 00:00

That looks like what I need. I'll test it out and update you. Thanks! (Nice post by the way)

Posted by Community Admin on 07-Jun-2013 00:00

I'm building a front end widget that posts a new draft blog post, and I need a rich text editor for the guts of the post. And I need to upload images potentially. Do you have an updated link or another example to do this?

Posted by Community Admin on 11-Jun-2013 00:00

Hello James,

You could use RadEditor of Telerik or the extended RadEditor of Sitefinity - HtmlField. In Sitefinity we're using a control called HtmlField for rich text editing and WYSIWYG experience. It wraps RadEditor inside, and has additional scripts implemented to serve the Document manager and Images manager dialogs, so they work properly with Sitefinity libraries.

To use HtmlField add the following line in the template:

<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.Fields" Assembly="Telerik.Sitefinity" %>

Example:
<sf:HtmlField
    ID="content"
    runat="server"
    DisplayMode="Write"
    EditorToolsConfiguration="Forums"
    HtmlFieldEditModes="Design"
    EditorContentFilters="DefaultFilters,RemoveScripts"
    EditorStripFormattingOptions="AllExceptNewLines"
    Height="200"
    Width="750"
    IsToOverrideDialogs="false">
</sf:HtmlField>



Regards,
Stefani Tacheva
Telerik
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 12-Mar-2015 00:00

Hi Stefani Tacheva,

 I have used the HtmlField in my user control and registered it to sitefinity. But that rich editor is not similar to rich editor in sitefinity please see the image attached, it has only few basic formatting options and more over Formatting Options link is coming at the right top side of the page even i have place the widget at the bottom of the page.

Can you please provide the additional scripts used to implement to serve the Document manager and Images manager dialogs so that i can have the rich text editor similar to the one in sitefinity.

Please help me on this.

 

Thanks 

Swetha

Posted by Community Admin on 26-Feb-2016 00:00

what is the procedure to delete the reply? 

Can any one delete this reply?

Posted by Community Admin on 26-Feb-2016 00:00

You need to add following code to your .ascx file. 

<%@ Register Assembly="Telerik.Sitefinity" TagPrefix="sfFields" Namespace="Telerik.Sitefinity.Web.UI.Fields" %>
<sitefinity:HtmlField
           ID="MyText"
           runat="server"
           ClientIDMode="Static"
           Width="99%"
           Height="370px"
           EditorContentFilters="DefaultFilters"
           EditorStripFormattingOptions="MSWord,Css,Font,Span,ConvertWordLists"
           DisplayMode="Write"
           FixCursorIssue="True">
</sitefinity:HtmlField>


And you need to use  get_value() and set_value() instead of using val() in its .js file.
Following are the two links where are well explained examples of how to use  "htmlField" or "RadEditor".

Creating a widget with sitefinity html field (Rich Text Editor)
Adding a Rich Text Editor (RadEditor) in a Sitefinity widget

Posted by Community Admin on 19-Jan-2017 00:00

So is there a way to get Image Manager and Document Manager working in a custom designer?

Posted by Community Admin on 27-Feb-2017 00:00

Never mind, for some odd reason I had the following setting in my HtmlField:

IsToOverrideDialogs=false

 

When I got rid of that, the Image Manager and Document Manager appear to work fine.

This thread is closed