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

Forums / Developing with Sitefinity / Custom wysiwyg editor

Custom wysiwyg editor

7 posts, 0 answered
  1. James Antrobus
    James Antrobus avatar
    10 posts
    Registered:
    05 Feb 2010
    09 Feb 2010
    Link to this post
    Is there a way to implement a custom wysiwyg editor such as TinyMCE? I understand I can create a custom web editor but I haven't found any way of including javascript on the front-end editor, without which I cannot implement a custom solution.

    I've tried using the inbuilt editor but it doesn't meet our needs. Standard text is wrapped in <div> which would require our clients to specifically select a style; TinyMCE defaults to <p> tags.

    Any help would be great,

    thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    09 Feb 2010
    Link to this post
    Hi James Antrobus,

    It would be possible,but you need to write your persistence classes to save the data entered - TinyMCE API . You could wrap the RaDEditor content in p tags using its ClientSide API

    function OnClientSubmit(editor) {
     
            var val = editor.get_html(true);
            editor.set_html('<p>' + val + '</p>');
    }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. James Antrobus
    James Antrobus avatar
    10 posts
    Registered:
    05 Feb 2010
    10 Feb 2010
    Link to this post
    Sorry, I meant on a per line basis. For example two lines in the editor would appear like this:

    <div>line1</div>
    <div>line2</div>

    where TinyMCE would render as:

    <p>line1</p>
    <p>line2</p>

    Is this possible with the SiteFinity editor?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Feb 2010
    Link to this post
    Hi James Antrobus,

    The code sample will add p tags to the content you have. If you type line1 and line2 the html after saving the content will be

    <p>line1</p>
    <p>line2</p>

    All the best,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  5. James Antrobus
    James Antrobus avatar
    10 posts
    Registered:
    05 Feb 2010
    10 Feb 2010
    Link to this post
    Thanks, where would I put this code?
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Feb 2010
    Link to this post
    Hello James Antrobus,

    You need to map the external template for the desired view and then subscribe for OnClientSubmit event of the RadEditor control. You could also take a look at RadEditor's API.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  7. James Antrobus
    James Antrobus avatar
    10 posts
    Registered:
    05 Feb 2010
    11 Feb 2010
    Link to this post
    Thanks, I eventually went down the route of creating my own CompositeControl and ControlDesigner so I had more control over my editor.

    Thanks for the help


Register for webinar
7 posts, 0 answered