ASPX templates
Version 5.x > ASPX templates > Changing the default logo? View modes: 
User avatar
Member
Member
gstaylor-sfopera - 4/20/2010 2:26:01 PM
   
Changing the default logo?
Using ASPX templates, how can change out the logo from the "Corporate Logo" image to one of our choosing?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 4/20/2010 2:52:16 PM
   
RE:Changing the default logo?
Hello,

Could you please give me more information about the mentioned logo? I am not sure which logo do you mean?

Best regards,
Boris Pocatko

User avatar
Member
Member
gstaylor-sfopera - 4/20/2010 3:13:12 PM
   
RE:Changing the default logo?
Hi Boris and thanks for the quick reply.

We installed the Corporate Site ASPX and I would like to change out the default logo image at the top of every page to our company logo.

User avatar
Member
Member
gstaylor-sfopera - 4/20/2010 5:21:40 PM
   
RE:Changing the default logo?
After some fumbling around, I finally found that the header image in root.master is set in the code behind page for the page. Once I found that, I changed out the reference to the image and all was fine.

User avatar
Member
Member
regina.chou-ntfund - 9/27/2010 8:56:36 PM
   
RE:Changing the default logo?
Hi, I'm having the same problem as you had. Could you please advise me how to change the default logo? Thanks very much, Regina

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 9/28/2010 2:17:37 AM
   
RE:Changing the default logo?
Hi,

in case of corporate site ASPX you can find the requested code in follwing two files:

1. ~/CMSTemplates/CorporateSiteAspx/Root.master
You can see that ID of control containing logo is imgLogo.

 <!-- Logo -->
<div class="zoneLogo">
<asp:HyperLink ID="lnkHome" runat="server" EnableViewState="false">
<asp:Image ID="imgLogo" runat="server" AlternateText="Logo" BorderWidth="0" EnableViewState="false" />
</asp:HyperLink>
</div>


2. ~/CMSTemplates/CorporateSiteAspx/Root.master.cs
In the code behind is set path to the logo image. You can change the path in following method.


protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);

ltlTags.Text = HeaderTags;
lnkHome.NavigateUrl = ResolveUrl("~/Home.aspx");
imgLogo.ImageUrl = ResolveUrl("~/Images-(1)/CompanyLogo.aspx");

lnkCMSDesk.NavigateUrl = ResolveUrl("~/CMSPages/logon.aspx?ReturnUrl=~/cmsdesk/default.aspx&username=administrator");
lnkSiteManager.NavigateUrl = ResolveUrl("~/CMSPages/logon.aspx?ReturnUrl=~/cmssitemanager/default.aspx&username=administrator");

lnkSiteMap.NavigateUrl = ResolveUrl("~/SpecialPages/Sitemap.aspx");
lnkDisclaimer.NavigateUrl = ResolveUrl("~/SpecialPages/Disclaimer.aspx");

imgPowered.ImageUrl = UIHelper.GetImageUrl(Page, "Powered_by_kentico.gif");

SignOutButton.ContentBefore = "<div class=\"signOut\">";
SignOutButton.ContentAfter = "</div>";
}


Best regards,
Ivana Tomanickova