Customize Insert an image dialog box
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,
Any advice?
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
>
Jen,
Thank you for your response, I will try this template out.