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

Forums / Bugs & Issues / Insert Link Text Overwrites Existing Selected Content

Insert Link Text Overwrites Existing Selected Content

11 posts, 0 answered
  1. JenF
    JenF avatar
    9 posts
    Registered:
    06 Jun 2007
    22 Jul 2008
    Link to this post
    When inserting hyperlinks or document links, we generally type all our content in the Generic Editor and then highlight the text that we want to be used as link text and then click on the hyperlink or document manager buttons.

    In version 3.2, however, I have noticed that the insert link dialog boxes have a field for Link Text and this seems to default to either the page title or document filename.

    The field does NOT pickup the text that was highlighted before clicking on the link manager button and anything that is placed in that field (either intentionally or more likely, unintentionally) will overwrite the previously highlighted content.

    It is disruptive to interrupt the flow of content creation to insert link text with the link manager so we prefer to type all content first before inserting links.

    How can we modify the link and document manager buttons so that if text is selected in the content editor, it will automatically be displayed in the link text field? Failing that, how do we stop that field from automatically generating link text based on page titles or doc names so that the selected text will not be overwritten?

    Thanks,
    Jennifer
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    24 Jul 2008
    Link to this post
    Hi Jen,

    Thank you for contacting us.

    I tested this behavior on Sitefinity 3.2. SP2 Hotfix 1616 and I could not reproduce it. I highlighted some text, then I clicked the link manager and the highlighted text appeared in the dialog. If you are not using our latest release with the hotfix, I would urge you to upgrade your project.

    On the other hand, is this behavior on a specific browser, or can you replicate it with all browsers?

    You may also consider returning the original RadEditor's Link Manager dialog, in case you use version 3.2SP1 or above. To do this, delete these lines of code from the template where you use the editor:

    Telerik.Web.UI.Editor.CommandList["LinkManager"] = 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"
                editor.get_Document().replaceChild(editorArgs, args); 
            else 
            { 
                var cloned = args.cloneNode(true); 
                var div = args.ownerDocument.createElement("DIV"); 
                div.appendChild(cloned); 
                editorArgs.pasteHtml(div.innerHTML); 
            } 
       } 
       editor.showExternalDialog( 
       '<%= Page.ResolveUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>'
       editorArgs,  
       750,  
       600,  
       myCallbackFunction,  
       null,  
       'ImageLibraryDialog',  
       false,  
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,  
       false,  
       false
    }; 
     
    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"
                editor.get_Document().replaceChild(editorArgs, args); 
            else 
            { 
                var cloned = args.cloneNode(true); 
                var div = args.ownerDocument.createElement("DIV"); 
                div.appendChild(cloned); 
                editorArgs.pasteHtml(div.innerHTML); 
            } 
       } 
       editor.showExternalDialog( 
       '<%= Page.ResolveUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %>'
       editorArgs,  
       750,  
       600,  
       myCallbackFunction,  
       null,  
       'ImageLibraryDialog',  
       false,  
       Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,  
       false,  
       false
    }; 
     

    Such a template is, for example, ControlPanelInsert.ascx, located in \[YourProject]\Sitefinity\Admin\ControlTemplates\Generic_Content. This template is used in Generic Content, when you create new items. The same could be done for the rest of the modules that use the RadEditor.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. JenF
    JenF avatar
    9 posts
    Registered:
    06 Jun 2007
    29 Jul 2008
    Link to this post

    Hello,

    Thanks for the followup.

    I confirmed that we are using Sitefinity 3.2 SP 2 Hotfix 1616.

    It does appear to be browser-specific as I am experiencing the problem with Internet Explorer 6.0 SP2. However, it is NOT an issue with Firefox 2 or 3.

    I welcome any suggestion you may have to resolve this issue in IE6. (Please note that IE6 is our corporate standard so upgrading to IE7 is not currently an option.)

    Thank you,
    Jennifer

  4. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    31 Jul 2008
    Link to this post
    Hello JenF,

    Actually this is a known issue. It is already fixed and will be available for the next release. In case you need it now you can find in the attachment an archive with all the templates which need changes. Note that you will have to overwrite all the templates which are using the RadEditor in order to overcome the issue. You would also need to overwrite the template for the links manager template which is located under ~/Sitefinity/Admin/ControlTemplates/Pages/Dialogs - LinksEditorDialog.ascx.

    Hope it helps.

    Kind regards,
    Vassil Daskalov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    27 Mar 2009
    Link to this post
    I tried this patch with 3.2 SP1 and it didn't work.  Is there a way to fix the issue for this version?

    J
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    30 Mar 2009
    Link to this post
    Hi Jason M,

    We did some work on the dialogs in Sitefinity 3.5. I suggest you patching your project with that version at least.

    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  7. Ian
    Ian avatar
    2 posts
    Registered:
    16 Mar 2009
    22 Apr 2009
    Link to this post
    Hi, this is happening for me as well, with SiteFinity 3.6 Hotfix and Firefox 2/3, also IE7.  Also I can't select an image and insert a link - the link text will overwrite the image.  Any fix for this?
  8. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    24 Apr 2009
    Link to this post
    Hi Ian,

    This functionality is working as expected in the 3.6 hotfix release under IE6. We have fixed this for firefox and IE7 in SP1.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. S. Webb
    S. Webb avatar
    36 posts
    Registered:
    28 Dec 2006
    04 May 2009
    Link to this post
    I am experiencing this as well, not with text but with images. I'm using version 1927 but I know it was the same in 1920 as well. There was one version that it worked but then I guess it got dropped.

    The problem is when you select an image that has been inserted in the generic content designer and then you select the link toolbar item, insert all of the link information, click OK and the image is then removed.

    Currently the only two ways you can add a link to an image in the generic content editor is to either add it through the html source or by adding an image map to the image. Not ideal for end users.

    What happened before is if an image was selected and you clicked the link item the link text attribute disappeared and it applied the link to the image successfully.

    Is there a fix for this?

    Thanks,
    Steve
  10. S. Webb
    S. Webb avatar
    36 posts
    Registered:
    28 Dec 2006
    04 May 2009
    Link to this post
    Appologies, this has been fixed with the latest service pack.

    Thanks,
    Steve
  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    05 May 2009
    Link to this post
    Hello S. Webb,

    I am glad it worked in your project.

    Don't hesitate to contact us if you have other questions.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
11 posts, 0 answered