How do I add a rich text editor to my own custom user control?
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!
Dan,
This blog post may be helpful to you. It has examples too! :)
Hope that helps!
That looks like what I need. I'll test it out and update you. Thanks! (Nice post by the way)
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?
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" %>
<
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
>
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
what is the procedure to delete the reply?
Can any one delete this reply?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
>
So is there a way to get Image Manager and Document Manager working in a custom designer?
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.