如何在共享点主页上输出站点标题

发布于 2024-08-17 10:12:59 字数 359 浏览 2 评论 0原文

我在 sharepoint 中有一个自定义母版页,并且想要在页面的不同部分输出网站标题。目前我可以看到使用以下代码输出的站点标题:

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

显然使用

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

也应该输出标题但不返回任何内容。有什么想法出了什么问题吗?

I have a custom masterpage in sharepoint and want to output the site title in a different part of the page. Currently I can see the site title which is outputted 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 the title but is returning nothing. Any ideas what is going wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

少钕鈤記 2024-08-24 10:12:59

您提到的代码是内容占位符,您可以在其中替换内容,您可以将注册以下标签放在页面顶部,

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

并放置以下代码以获取页面标题

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

如果您想在您可以使用以下代码执行母版页级别

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

除非您覆盖上面的内容占位符,否则您将自动获得网站的标题

The Code you have mentioned are the Content Place Holders where you can replace the Content, You can place the register the below tag in the top the page and

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

And place the below code to get the Title of the Page

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

If you want to do that in the master page level you can do with the below code

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

Unless you override the above content place holder you will get the Title of the Web Automatically

深府石板幽径 2024-08-24 10:12:59

这可以通过使用 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>

This can be done by using the ProjectProperty control (see 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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文