Question

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?

Was it helpful?

Solution

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>

OTHER TIPS

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"/>

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top