I created a custom SharePoint master page based on SharePoint default.master. I found that the flashy site logo that I specified in the custom master page is not used. Instead, my application page uses the prosaic default SharePoint site logo. In the master page, the site logo is specified by the following mark-up:
<SharePoint:SiteLogoImage ID= "onetidHeadbnnr0" LogoImageUrl= "/_layouts/images/SoftArtisans/logo.png" runat= "server" />
|
It turns out that the SiteLogoImage control is quite intelligent. It picks up the image specified in the Site Settings > Look and Feel > Title, description and icon > Logo URL and description setting. The URL specified in the control is only used if the Logo URL and description field is empty. This is great if you want to allow a user, with the appropriate permissions, to specify the site logo. However, for our purpose, we want to custom-brand the site with a fixed logo.
To get the desired change, simply replace the above mark-up with a standard HTML <img> tag. You’d get the added benefit of reducing the number of server controls.
For future reference you may want to comment out the above mark-up instead of removing it entirely. If so, use the ASPX <%- --%> comment syntax rather than the HTML <!- --> comment syntax. ASPX comments are removed completely, resulting in a smaller file size for the generated HTML.
Share the post "Site Logo and Custom SharePoint Master Page"