locked
Master page with only web part zones RRS feed

  • Question

  • Is it only possible to use a WIKI page for the master page in SharePoint?  If I want to have nothing but web part zones in my new custom master I'm building, is this possible?  From what I am understanding from other posts, only WIKI pages can be used for master pages so no web part zones are possible? 

    Ideally I would like to use an existing page template for my master but can't find out how to accomplish this in Visual Studio.  One if the page templates contains nothing but web part zones.  I would like this for my master.

    • Edited by jd_hancock Friday, April 26, 2013 2:38 PM
    Friday, April 26, 2013 2:36 PM

Answers

  • Hi jd_hancock,

    By design, it is not allowed to add web part zone to master page directlly.

    What we can use to fix the issue is:

    1. Add a ContentPlaceholder to the master page
    2. Create a new Page Layout
    3. Add web part zone to the page Layout
    4. Create a new page based on the new page layout

    Thanks,
    Jinchun Chen


    Jinchun Chen(JC)
    TechNet Community Support

    Monday, April 29, 2013 9:24 AM

All replies

  • you can open the master page in SharePoint designer and use below code to add web part zone in master page

    Reference URL: http://sharepointpublishing.blogspot.in/2011/09/add-webpart-zone-on-masterpage-in.html

    In your masterpage add the webpart zone wherever you want:
    <asp:ContentPlaceHolder id="MyWebpartZone" runat="server"></asp:ContentPlaceHolder>
     Add the following tag anywhere in your layout pages
    <asp:Content ContentPlaceHolderId="WeatherPart" runat="server">
    <div>
    <WebPartPages:WebPartZone runat="server" Title="WeatherPart" ID="WeatherPart"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
    </div>
    </asp:Content>


    Mark this post as answer if this resolves your issue.


    Everything about SQL Server | Experience inside SQL Server -Mohammad Nizamuddin

    Friday, April 26, 2013 4:06 PM
  • Thanks Mohammad.  Received the following error:

    Content controls have to be top-level controls in a content page or a nested master page that references a master  page

    Designer said that web part zones cannot be added to master pages. Only aspx pages attached to the master.  Looks like only Microsoft can do this. 

    I guess I need to create a template that inherits from the master and use that for the master when creating a new site or page.  No clue how to do this.  Thinking only Microsoft can do this also.


    I think what I am attempting to do is create a visual studio solution that defines the master, adds a default.aspx page that inherits from the master.  Thinking this is not doable.  Everything I have read requires Designer.  Not an option.
    • Edited by jd_hancock Saturday, April 27, 2013 3:06 PM
    Saturday, April 27, 2013 1:17 AM
  • Hey,

    What's the reason for adding the web part zones to the master page instead of a page layout?

    Thanks and have a great day!

    Werner


    I find it distasteful to beg for 'Mark as Answer' and 'Mark as helpful'. It's supposed to be about helping people, not about getting the high score.

    Monday, April 29, 2013 9:01 AM
  • Hi jd_hancock,

    By design, it is not allowed to add web part zone to master page directlly.

    What we can use to fix the issue is:

    1. Add a ContentPlaceholder to the master page
    2. Create a new Page Layout
    3. Add web part zone to the page Layout
    4. Create a new page based on the new page layout

    Thanks,
    Jinchun Chen


    Jinchun Chen(JC)
    TechNet Community Support

    Monday, April 29, 2013 9:24 AM