In this article we will discuss how we can add a webpart zone out side the PlaceHolderMain ContentPlaceholder in SharePoint 2010. You can all see how to create a Page Layout using SharePoint 2010 designer here. Also you can check some Master Page and Page Layout articles here.
By using this link, you can create a layout in SharePoint 2010 designer. If you will look carefully then it allows us to add webpart zone inside the PlaceHolderMain contentplaceholder.
Besides that you can also add web part zones out this, more specifically you can also define
your own contentPlaceholder in the master page and also you can add your own webpart zones to the custom contentPlaceholder
To add a ContentPlaceholder in the master page, Open the master page using SharePoint 2010 designer (You can visit this article on Create custom master page by using SharePoint designer 2010 in SharePoint 2010) and then add a contentplaceholder like below:
<asp:ContentPlaceHolder ID="PlaceHolderCustom" runat="server">
</asp:ContentPlaceHolder>
Once you will define the ContentPlaceHolder it is the time now to add the webpart zones to the particular placeholder in the page layout. Now open your custom page layout using SharePoint Designer 2010 and put code like below outside PlaceHolderMain:
<asp:Content ContentPlaceholderID="PlaceHolderCustom" runat="server">
<WebPartPages:WebPartZone id="IDOfWebPartZone" runat="server" title="Title of WebPart Zone"> <ZoneTemplate> </ZoneTemplate> </WebPartPages:WebPartZone>
</asp:Content>
Here one thing need to remember is that ContentPlaceholderID name should match with the ID of ContentPlaceHolder in the master page. Here the name is PlaceHolderCustom.
By using this link, you can create a layout in SharePoint 2010 designer. If you will look carefully then it allows us to add webpart zone inside the PlaceHolderMain contentplaceholder.
Besides that you can also add web part zones out this, more specifically you can also define
your own contentPlaceholder in the master page and also you can add your own webpart zones to the custom contentPlaceholder
To add a ContentPlaceholder in the master page, Open the master page using SharePoint 2010 designer (You can visit this article on Create custom master page by using SharePoint designer 2010 in SharePoint 2010) and then add a contentplaceholder like below:
<asp:ContentPlaceHolder ID="PlaceHolderCustom" runat="server">
</asp:ContentPlaceHolder>
Once you will define the ContentPlaceHolder it is the time now to add the webpart zones to the particular placeholder in the page layout. Now open your custom page layout using SharePoint Designer 2010 and put code like below outside PlaceHolderMain:
<asp:Content ContentPlaceholderID="PlaceHolderCustom" runat="server">
<WebPartPages:WebPartZone id="IDOfWebPartZone" runat="server" title="Title of WebPart Zone"> <ZoneTemplate> </ZoneTemplate> </WebPartPages:WebPartZone>
</asp:Content>
Here one thing need to remember is that ContentPlaceholderID name should match with the ID of ContentPlaceHolder in the master page. Here the name is PlaceHolderCustom.