views:

463

answers:

1

I am trying to print the breadcrumb and title of a page in share point using a custom.master. I tried using the following code:

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

This is not outputting anything to the screen. The breadcrumb and title are displaying in

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

However I want to get the content out from there and display it in a different part of the page. How would I go about doing this?

A: 

You can specify what's inside your PlaceHolderMain and move all of its default contents to somewhere outside. Then, add the Breadcrumb placeholders where they belong.

That is, in your master page you make an epmty "PlaceHolderMain":

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

And you will have to fild place somewhere else on your page for the following placeholders:

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

See the "minimal master" articles from Microsoft http://msdn.microsoft.com/en-us/library/aa660698.aspx as well as from Heater Solomon: http://www.heathersolomon.com/blog/archive/2007/01/26/6153.aspx

Also, take a look at how Microsoft people have made their master pages bundled with MOSS. You can find them on your MOSS server, "\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\PublishingLayouts\MasterPages"

naivists
How do I override ContentPlaceHolder ?
Linda
Hmm, "override" was not a good term here. Changed my answer a bit, I think it's worth looking at the built-in "publishing layouts".
naivists