PlaceHolderMain在Sharepoint中显示痕迹和标题

时间:2010-01-04 11:27:25

标签: sharepoint moss sharepoint-2007

我正在尝试使用custom.master在共享点中打印页面的痕迹和标题。我尝试使用以下代码:

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

这不会向屏幕输出任何内容。面包屑和标题显示在

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

但是我想从那里获取内容并将其显示在页面的不同部分。我该怎么做呢?

1 个答案:

答案 0 :(得分:0)

您可以指定PlaceHolderMain中的内容,并将其所有默认内容移到外面的某个位置。然后,添加它们所属的Breadcrumb占位符。

也就是说,在您的母版页中,您创建了一个epmty“PlaceHolderMain”:

<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
 <!--nothing inside here -->
</asp:ContentPlaceHolder>

您必须在页面上的其他位置放置以下占位符:

<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea"  runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderPageImage" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderBodyLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderNavSpacer" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleLeftBorder" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderTitleAreaSeparator" runat="server"/>
<asp:ContentPlaceHolder ID="PlaceHolderMiniConsole" runat="server"/>
<asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat ="server" />
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat ="server"/>
<asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server" />

请参阅Microsoft http://msdn.microsoft.com/en-us/library/aa660698.aspx以及Heater Solomon的“minimal master”文章:http://www.heathersolomon.com/blog/archive/2007/01/26/6153.aspx

另外,看看微软人如何将他们的母版页与MOSS捆绑在一起。您可以在MOSS服务器上找到它们,“\ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ FEATURES \ PublishingLayouts \ MasterPages”