+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / How do I add a rich text editor to my own custom user control?

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

8 posts, 0 answered
  1. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    03 Dec 2011
    Link to this post
    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!
  2. Tim
    Tim avatar
    258 posts
    Registered:
    22 Jun 2011
    03 Dec 2011
    Link to this post
    Dan,

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

    Hope that helps!
  3. Dan Sorensen
    Dan Sorensen avatar
    256 posts
    Registered:
    13 Aug 2010
    05 Dec 2011
    Link to this post
    That looks like what I need. I'll test it out and update you. Thanks! (Nice post by the way)
  4. James B.
    James B. avatar
    24 posts
    Registered:
    17 Jan 2011
    07 Jun 2013 in reply to Tim
    Link to this post
    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?
  5. Stefani Tacheva
    Stefani Tacheva avatar
    718 posts
    Registered:
    21 Nov 2016
    11 Jun 2013
    Link to this post
    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
  6. Swetha
    Swetha avatar
    5 posts
    Registered:
    09 Jan 2015
    12 Mar 2015
    Link to this post

    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

  7. Tabish Usman
    Tabish Usman avatar
    25 posts
    Registered:
    27 May 2011
    26 Feb in reply to Swetha
    Link to this post

    what is the procedure to delete the reply? 

    Can any one delete this reply?
  8. Tabish Usman
    Tabish Usman avatar
    25 posts
    Registered:
    27 May 2011
    26 Feb
    Link to this post
    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

8 posts, 0 answered