How to customize title tag in SharePoint 2010 masterpages

This is a very simple “trick” that might come in handy if you want to customize the title tag of you SharePoint 2010 site.

If you add any text to the title tag, it will simply be ignored, it doesn't show up in the browser, and you don’t get any error either.

<title id="onetidTitle">
        My Portal: <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/>

You might spend a lot of precious time trying to figure out what’s wrong, and even if it’s possible to use your chosen title format.

It is possible, and this is how you do it, using an encoded literal:

<title id="onetidTitle">
 <SharePoint:EncodedLiteral runat="server" text="My Portal: " EncodeMethod='HtmlEncode' />
 <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/>                

Keep up to date

Our monthly newsletter. See previous editions.

Related articles