How to display the site name on the sharepoint home page

I have a custom homepage in sharepoint and want to display the site name in another part of the page. Currently, I can see the name of the site, which is displayed using the following code:

<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" Visible="true" />

Apparently using

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" Visible="true" />

Should also output a header, but returns nothing. Any ideas what is going wrong?

+3
source share
2 answers

The code you mentioned is the owner of the content placement where you can replace the content, you can put the tag below the register at the top of the page and

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 

And put the code below to get the page title

    <SharePoint:ProjectProperty Property="Title" runat="server" />

,

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" Visible="true">
 <SharePoint:ProjectProperty Property="Title" runat="server" />
 </asp:ContentPlaceHolder>

, -

+6

ProjectProperty (. http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.projectproperty.aspx)

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">
   <SharePoint:ProjectProperty property="Title" runat="server" />
</asp:ContentPlaceHolder>
+1

Source: https://habr.com/ru/post/1727623/


All Articles