Friday, July 24, 2009

Custom logo and site name in SharePoint master page

Today when I was branding my master page, I had to change the default view of how the logo and site name are displayed in the SharePoint Blueband.master.

I started off with a copy of Blueband.master which has the below control that renders the image followed by the site name(url):

<sharepoint:aspmenu id="logoLinkId" runat="server" datasourceid="SiteMapDataSourceRoot" staticdisplaylevels="1" maximumdynamicdisplaylevels="0" accesskey="1" cssclass="logo">
</sharepoint:aspmenu>

As my company logo is a bit big, I wanted the image and site name to be displayed in seperate rows and I also wanted to apply my own styles to them.
The approach below from Heather Soloman's blog interested me.

<sharepoint:sitelogoimage id="onetidHeadbnnr0" logoimageurl="/_layouts/images/titlegraphic.gif" runat="server"/>
<asp:contentplaceholder id="PlaceHolderSiteName" runat="server">
<sharepoint:splinkbutton runat="server" navigateurl="~site/" id="onetidProjectPropertyTitle">
<sharepoint:projectproperty property="Title" runat="server">
</sharepoint:projectproperty>
</sharepoint:splinkbutton>
</asp:contentplaceholder>

But as I needed a bit more control, I finally ended up with my own code:

<asp:Image runat="server" id="XXX" ImageUrl="/_layouts/XXXMasterPages/images/xxxLogo.gif" />
<p class="xxxSiteNameContainer">
<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle" CssClass="xxxSiteName">
<SharePoint:ProjectProperty ID="ProjectProperty1" Property="Title" runat="server" />
</SharePoint:SPLinkButton>
</p>

An error occurred during the processing of . Unknown server tag 'asp:ScriptManager'.

So I have changed the default.master for testing some thing and have forgotten to revert it back.
This is what I ended up with when I attempted to open Central Administration default.aspx page.
"An error occurred during the processing of . Unknown server tag 'asp:ScriptManager'"

So went back to the 12 hive Global folder and reverted the default.master to its original state.
Central Administration's default.aspx page uses default.master.

Wednesday, July 8, 2009

The first post

My intention behind starting this blog is to blog down the pit falls, frustations, nice to have's, fixes, features I encounter while developing applications in SharePoint, WCF, WF, CSS, AJAX, SQL Server ..... whatever I know which I feel will be of use for me and others in future.
Consider this as my scribble pad