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

Forums / Developing with Sitefinity / removing image module in config - still shows in insert image

removing image module in config - still shows in insert image

6 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    13 May 2009
    Link to this post
    Hi
    I've disabled the images and document module in the config

    however, when in the editor and you try and insert and image, it asks you to select an image from the image and document module.

    is there a way to remove this/ or default so they always pick images from file system?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    13 May 2009
    Link to this post
    Hi Quade,

    Thank you for using our services.

    You can remove the js with CommandList["LibraryImageManager"] and CommandList["LibraryDocumentManager"] from the templates you want to disable selecting from already uploaded images through Sitfinity UI. Thus, the editor will start using the default dialogs where you can set a certain directory for picking images.

    Sincerely yours,
    Ivan Dimitrov
    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.
  3. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    13 May 2009
    Link to this post
    Hi Ivan

    THanks for this

    Can you be a little more specific please
    in particular, when in the editor, i click insert image, and i want to select one already on the CMS, I need to default to the file system/remove libary option,

    which file do i need to edit for this
    forgot to say, i'm using 3.2 sp2
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    13 May 2009
    Link to this post
    Hello Quade,

    Generally you can edit ControlPanelInsert and ControlPahelEdit templates that are located under ControlTemplates folder for each provider you have. The templates contains js code which we have added to customize the Edtor Image and Documents manager.

    Sincerely yours,
    Ivan Dimitrov
    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.
  5. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    13 May 2009
    Link to this post
    thanks Ivan

    I'm looking in

    sitefinity/admin/controltemplates/generic_content/controlpaneledit.ascx
    sitefinity/admin/controltemplates/generic_content/controlpanelinsert.ascx

    what would i need to change to make it show the file system first when inserting an image?

    Thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    13 May 2009
    Link to this post
    Hello Quade,

    Here is the code that you should remove. Thus you will force the editor to use its default managers.

     Telerik.Web.UI.Editor.CommandList["LibraryImageManager"] = 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 == "IMG"
                                            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/ImageEditorDialog.aspx") %>'
                                   editorArgs,  
                                   750,  
                                   600,  
                                   myCallbackFunction,  
                                   null,  
                                   'ImageLibraryDialog',  
                                   true,  
                                   Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,  
                                   false,  
                                   false
                                }; 
                                 
                                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( 
                                   '<%= Page.ResolveUrl("~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx") %>'
                                   editorArgs,  
                                   750,  
                                   600,  
                                   myCallbackFunction,  
                                   null,  
                                   'ImageLibraryDialog',  
                                   false,  
                                   Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,  
                                   false,  
                                   false
                                }; 
     

    Check out http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

    All the best,
    Ivan Dimitrov
    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
6 posts, 0 answered