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

Forums / Bugs & Issues / WYSIWYG Editor: Inserting links

WYSIWYG Editor: Inserting links

4 posts, 0 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    14 Dec 2009
    Link to this post
    Hi,

    In the WYSIWYG editor we're seeing a very different screen from what appears in the editor I'm typing in right now. We use Sitefinity 3.6. The first attachment is your editor Link Manager, the second is ours.

    How do we get that functionality for our users?

    Regards,
    Jacques
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Dec 2009
    Link to this post
    Hi J.Hov,

     wysiwyg-editor-on-sitefinity.jpg is the built in RadEditor dialog for inserting HyperLinks. The second image represents our customized dialog. 

    Could you tell me where exactly you want to see one of the dialogs and which one ( it is not specified in your request) so I could point you to the right direction.


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    15 Dec 2009
    Link to this post
    Hi Ivan,

    This would be in either the news "edit" view or the generic content "edit" view. You highlight a word then click the link button.

    Does that help?

    Regards,
    Jacques
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Dec 2009
    Link to this post
    Hi J.Hov,

    Thank you for getting back to us.

    Note that you can substitute the Sitefinity link manager dialogs in your control templates with the original ones. Just map the control templates for creating and editing news and remove this JS code from the control template:
    Telerik.Web.UI.Editor.CommandList["LinkManager"] = function(commandName, editor, args)
                       {
                          var editorArgs = editor.getSelectedElement();
                          if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                          {                                                                  
                               var sel = editor.getSelection(); 
                               editorArgs = sel;
                               editorArgs.Html = sel.getHtml();
                               editorArgs.Text = sel.getText();                                   
                          }
                           
                          var myCallbackFunction = function(sender, args)
                          {
                               if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                                   args.parentNode.replaceChild(editorArgs, args);
                               else
                               {
                                   var cloned = args.cloneNode(true);
                                   var div = args.ownerDocument.createElement("DIV");
                                   div.appendChild(cloned);
                                   editorArgs.pasteHtml(div.innerHTML);
                               }
                          }
                          editor.showExternalDialog(
                          '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                          editorArgs,
                          750,
                          600,
                          myCallbackFunction,
                          null,
                          'ImageLibraryDialog',
                          false,
                          Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                          false,
                          true)
                       };
     
                       Telerik.Web.UI.Editor.CommandList["SetLinkProperties"] = function(commandName, editor, args)
                       {
                          var editorArgs = editor.getSelectedElement();
                          if (!editorArgs.nodeName || typeof(editorArgs.nodeName) == "undefined" || editorArgs.nodeName != "A")
                               editorArgs = editor.getSelection();
                           
                          var myCallbackFunction = function(sender, args)
                          {
                               if (typeof(editorArgs.nodeName) != "undefined" && editorArgs.nodeName == "A")
                                   args.parentNode.replaceChild(editorArgs, args);
                               else
                               {
                                   var cloned = args.cloneNode(true);
                                   var div = args.ownerDocument.createElement("DIV");
                                   div.appendChild(cloned);
                                   editorArgs.pasteHtml(div.innerHTML);
                               }
                          }
                          editor.showExternalDialog(
                          '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>',
                          editorArgs,
                          750,
                          600,
                          myCallbackFunction,
                          null,
                          'ImageLibraryDialog',
                          false,
                          Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                          false,
                          true)
                       };

    Alternatively if you want to use the Sitefinity dialogs for links you just need to add this java script to the control templates where you have the RadEditor. Please note that if you use the standard RadEdtitor dialogs you will not be able to select pages from SiteMap - this is why we have the custom dialogs.

    Regards,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered