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

Forums / General Discussions / Anchor tags

Anchor tags

6 posts, 0 answered
  1. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    03 Dec 2008
    Link to this post
    How do I add anchor tags without having to edit HTML when using Sitefinity 3.5?
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    04 Dec 2008
    Link to this post
    Hello Jeff,

    I assume you mean adding anchor tags in the RadEditor control. If it is so, you could use Insert a link or Insert a document managers. Have a look at the attached screenshot for details.

    Please describe in details if there is some misunderstanding.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    04 Dec 2008
    Link to this post
    I think jeff is refering to named anchors like < a name="section">

    so that you can jump around the page. I haven't found a way to do this without going into the html source view and manually entering them.
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    04 Dec 2008
    Link to this post
    Hello,

    Thanks a lot for the clarification.
    The first option is to enter manually the name attribute of the <a> element. Another possible solution is to roll back the built-in RadEditor LinkManager that provides the required functionality to create anchors. To achieve this, do the following:

    1. Open these files:
    ~/Sitefinity/Admin/ControlTemplates/Generic_Content/EditorTemplate.ascx
    ~/Sitefinity/Admin/ControlTemplates/[Name_of_Module]/ControlPanelInsert.ascx
    ~/Sitefinity/Admin/ControlTemplates/[Name_of_Module]/ControlPanelEdit.ascx
    2. Comment the following javascript code:

    Telerik.Web.UI.Editor.CommandList["LinkManager"] = function(commandName, editor, args) 
       var editoreditorArgs = 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( 
       '<%= 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) 
    }; 

    Hope you will find the provided information useful.

    Sincerely yours,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Jeff Mah
    Jeff Mah avatar
    31 posts
    Registered:
    25 Feb 2005
    20 Dec 2008
    Link to this post
    Using the LInk Manager works great for anchors and targets, however, it removes the ability to select a page in the current site. Is there no way to have that functionality as well?
  6. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    20 Dec 2008
    Link to this post
    Hello Jeff,

    This functionality (to select pages from the site map of the current project) is provided only by Sitefinity Link Manager. However, it does not support creating anchors. This means that if you use Sitefinity Link Manager you will have to enter the anchors manually.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
6 posts, 0 answered