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

Forums / Developing with Sitefinity / Customize Insert an image dialog box

Customize Insert an image dialog box

4 posts, 0 answered
  1. kiran
    kiran avatar
    43 posts
    Registered:
    17 Nov 2010
    02 Nov 2011
    Link to this post
    Hi,
    In the previous version of Sitefinity (3.7) we were able to able to edit the dialog boxes for inserting an image by editing the  ImageEditorDialog.ascx control in the Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\ folder...

    We would like to hide the "From your computer" option when a user is inserting an image into a page. I was able to accomplish this in the older version of 3.7 Sitefinity by hiding this option. But, I would like to create the same functionality in Sitefinity 4.2

    How can I edit the insert an image dialog box to hide the "From your computer" option from the image manager?

    Thank you,


  2. kiran
    kiran avatar
    43 posts
    Registered:
    17 Nov 2010
    04 Nov 2011
    Link to this post
    Any advice?
  3. Jen Peleva
    Jen Peleva avatar
    568 posts
    Registered:
    10 Nov 2016
    07 Nov 2011
    Link to this post
    Hi Kiran,

    That's a tough one, I'm afraid there's no out of the box solution for hiding the rom your computer tab. One possible way, although not perfect  can be achieved with the use of a custom template. You have to map it to the image designer to make it work (Go to Administration -> Settings -> Controls -> ViewMap). Its HostType is Telerik.Sitefinity.Modules.Libraries.Web.UI.Designers.ImageSettingsDesigner. We've prepared a sample for you.
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ImageSettingsCustom.ascx.cs" Inherits="SitefinityWebApp.ControlTemplates.Other.ImageSettingsCustom" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sitefinity" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.Fields" TagPrefix="sfFields" %>
    <%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Modules.Libraries.Web.UI.Designers" TagPrefix="sfViews" %>
     
    <sitefinity:ResourceLinks ID="resourcesLinks" runat="server">
        <sitefinity:ResourceFile JavaScriptLibrary="JQuery"></sitefinity:ResourceFile>
        <sitefinity:ResourceFile Name="Styles/Tabstrip.css" />
    </sitefinity:ResourceLinks>        
     
    <sfFields:FormManager id="formManager" runat="server"/>
             
    <sitefinity:Message ID="message" runat="server"
                ElementTag="div"
                CssClass="sfMessage sfDesignerMessage"
                RemoveAfter="50000"
                FadeDuration="10"  />
                 
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server"
                         Skin="Sitefinity"
                         MultiPageID="designerTabsMultiPage"
                         OnClientLoad="OnClientLoad"
                         SelectedIndex="0"
                         OnClientTabSelected="OnClientTabSelected"
                         CssClass="sfSwitchControlViews">
    </telerik:RadTabStrip>
     
    <telerik:RadMultiPage ID="designerTabsMultiPage" runat="server"
                          SelectedIndex="0"
                          CssClass="sfContentViews">
    </telerik:RadMultiPage>
     
    <script type="text/javascript">
    function pageLoad(){
            var multiPage = $find("<%=designerTabsMultiPage.ClientID %>");
            multiPage.set_selectedIndex(1);
    }
        function OnClientLoad(sender) {
    var tabStrip1 = sender;
          var tab2 = tabStrip1.findTabByText("From already uploaded");
          tab2.set_selected(true);
          var tab = tabStrip1.findTabByText("From your computer");
          tab.set_visible(false);    
        }
     
        function OnClientTabSelected(sender, eventArgs) {
            //dialogBase.resizeToContent();
        }
             
        </script>
    However, the resize to content functionality seems to stop working after the modifications applied, most likely due to the missing first tab. For further information you might refer to our RadTabStrip documentation.

    Greetings,
    Jen Peleva
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. kiran
    kiran avatar
    43 posts
    Registered:
    17 Nov 2010
    08 Nov 2011
    Link to this post
    Jen,

    Thank you for your response, I will try this template out.
4 posts, 0 answered