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

Forums / Developing with Sitefinity / Radeditor that has the PageLinker

Radeditor that has the PageLinker

2 posts, 0 answered
  1. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    29 Apr 2010
    Link to this post
    How do I get a RadEditor onto the page that the Hyperlink editor allows me to pick from site pages instead of static URLs?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    29 Apr 2010
    Link to this post
    Hello Steve,


    1. You could use the built-in dialogs

    <fieldset class="set">                   
                <div class="setIn">
                    <telerik:RadEditor
                        runat="server"
                        ID="Editor"
                        ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css"
                        ToolsFile="~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml"                  
                        Skin="WebBlue"                    
                        NewLineBr="False"
                        Width="95%"
                        ContentFilters="EncodeScripts,FixUlBoldItalic,FixEnclosingP,IECleanAnchors,MozEmStrong,ConvertFontToSpan,ConvertToXhtml,IndentHTMLContent">
                        <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" />
                        <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
                        <CssFiles>
                            <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
                        </CssFiles>
                    </telerik:RadEditor>
                    <script type="text/javascript">
     
                   
                    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)
                    };
                           
                     
                    </script>


    2. Implement your own dialog that has RadTreeView populated with the SiteMap pages and return the selected node as link.


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
2 posts, 0 answered