More in this section

Forums / Developing with Sitefinity / RadEditor tool

RadEditor tool

8 posts, 0 answered
  1. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    08 Feb 2010
    Link to this post
    Hi

     I want to add a insert document tool button into the rad Editor.


    i tried like this but it's not working.

    in ~\RadControls\Editor\ToolsFile.xml

      <tools name="InsertToolbar" dockable="false">

        <tool name="LibraryDocumentManager" text="Insert a document"/>
        <tool name="DocumentManager" />
      </tools>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2010
    Link to this post
    Hello asit pani,

    If you want  to insert documents from Images and Documents module  you have to use LibraryDocumentManager

    <tool name="LibraryDocumentManager" text="Insert a document"/>

    If the problem persists, please provide us with some more details about the problem you have.

    Regards,
    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. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    08 Feb 2010
    Link to this post
    hi
     thanks for ur reply.

    But i already added that to my xml file but it's showing error. i have added this error in the attached file.

    and when i m using Document manager the upload document tab is disabled.please tell me how to enable it.


    thanks

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2010
    Link to this post
    Hi asit pani,

    You have to add the following script in the template where you have declared RadEditor control

    Telerik.Web.UI.Editor.CommandList["LibraryDocumentManager"] = 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/DocumentEditorDialog.aspx") %>',
                     editorArgs,
                     750,
                     600,
                     myCallbackFunction,
                     null,
                     'ImageLibraryDialog',
                     false,
                     Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
                     false,
                     true)
                  };

    Otherwise you have to use the default document manager of RadEditor control which does not support Images and Documents module by design.

    Kind regards,
    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. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    08 Feb 2010
    Link to this post
    hi

    Adding this i m getting this error

    Unable to cast object of type 'ASP.qfc_components_publicregister_firm_disciplinaryactions_adddisciplinaryaction_aspx' to type 'Telerik.Cms.Web.CmsPageBase'.

    Server Error in '/' Application.

    Unable to cast object of type 'ASP.qfc_components_publicregister_firm_disciplinaryactions_adddisciplinaryaction_aspx' to type 'Telerik.Cms.Web.CmsPageBase'.

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2010
    Link to this post
    Hello asit pani,

    Could you tell us which version of Sitefinity are you using? Is it possible that you are using an older version of Sitefinity (for example Sitefinity 3.6 SP2) In the older versions of Sitefinity, the line that is giving you errors was:


    '<%= Page.ResolveUrl("~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx") %>',


    Best wishes,
    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. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    08 Feb 2010
    Link to this post
    hi
     I m using version : 3.7.2022.2
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Feb 2010
    Link to this post
    Hi asit pani,

    This is the javascript used in your version of the CMS. You can always take the external template for the GenericContentDesigner control and take the javascript from there:
    Telerik.Web.UI.Editor.CommandList["LibraryDocumentManager"] = 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);
        }
        }
                  var path = '<%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx") %>';
        editor.showExternalDialog(
        path,
        editorArgs,
        750,
        515,
        myCallbackFunction,
        null,
        'ImageLibraryDialog',
        false,
        Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
        false,
        true)
        };


    Regards,
    Radoslav Georgiev
    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.
Register for webinar
8 posts, 0 answered