SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the starter master pages from Codeplex, and I want to have the current SiteName on each page. What is the best way to do that dynamically?

share|improve this question
up vote 7 down vote accepted

Insert <SharePoint:ProjectProperty Property="Title" runat="server"/> into the masterpage where you want it.

Or if you want it like the default v4.master with a being in the PlaceHolderSiteName ContentPlaceHolder as a link, then use

<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
    <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle"><SharePoint:ProjectProperty Property="Title" runat="server" /></SharePoint:SPLinkButton>
share|improve this answer
Perfect for me! – jpussacq Apr 22 at 13:30

There is a out of the box content placeholder containing the site name that can be placed inside your masterpage. I believe Randy has it included in the block of content placeholders at the bottom of the page, and you can just bring it up to where you want it.

<asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server"/>

share|improve this answer
I know. I tried that but it doesn't return any data... – mmcglynn Jun 7 '12 at 15:18
Confirm your site has a name: Site Settings -> Title, Description and Icon. – webdes03 Jun 7 '12 at 15:23
Inserting an empty ContentPlaceHolder will require every PageLayout/Page to add the ProjectProperty inside – Per Jakobsen Jun 7 '12 at 19:45
Title, Description and Icon have data. – mmcglynn Jun 8 '12 at 17:53
As Per stated (and I didn't really give you a full solution), <asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server"/> gives you the placeholder that you'd fill with the property. If that placeholder exists on your masterpage or page layout, then you can fill it with <SharePoint:ProjectProperty Property="Title" runat="server" /> which will return the site title from the "Title, Description, and Icon" configuration. – webdes03 Jun 9 '12 at 14:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.