Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 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>
</asp:ContentPlaceHolder>
share|improve this answer

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
1  
Confirm your site has a name: Site Settings -> Title, Description and Icon. –  webdes03 Jun 7 '12 at 15:23
1  
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

 
discard

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.