1

I have successfully created the master page (Sharepoint 2013) and layout page from html file but unable to add webpart zones to the body.

    <div id="maincontentcontainer">

        <div id="maincontenttop">
        </div>
        <div id="maincontentbottomleft">
        </div>
        <div id="maincontentbottomright">
        </div>
    </div>
    <div id="rightsidebarcontainer">
        <div id="rightsidebar">

        </div>
    </div>

this is the body stucture and i want to add webpart zones or content placeholders to these divs(to be able to add webparts). any help in doing this would be great thanks.

  • You can not add webpart zones to a master page, you have to add them to a page layout or other kind of page – Robert Lindgren Jul 4 '16 at 14:48
  • Yes, i don't want to, but this is the layout which i want my pages to have and structure wise : layout goes into master and master get attached to pages.So my question is to how do i get this layout to my page via master. – user3639530 Jul 5 '16 at 8:52
  • The structure is Page USES PageLayout, PageLayout USES Master page. So you should create a Page Layout, not a master page – Robert Lindgren Jul 5 '16 at 8:54
  • I have created both PageLayout and master page from same html file. and have attached master page to wikipage from designer.but any content place holde or webpart zone added to layout Html file not reflecting on page. – user3639530 Jul 5 '16 at 9:50
  • It is not possible to create a master page and a page layout from the same file. – Robert Lindgren Jul 5 '16 at 9:52
0

You can try this:

1) Open your SharePoint Designer and click on Page Layouts present in Site Object.

2) Choose the Folder in which you have create a page layouts

3) Click on create New Page Layout present in the ribbon

4) Place your HTML Between this:

<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
  <div id="maincontentcontainer">

        <div id="maincontenttop">
        </div>
        <div id="maincontentbottomleft">
        </div>
        <div id="maincontentbottomright">
        </div>
    </div>
    <div id="rightsidebarcontainer">
        <div id="rightsidebar">

        </div>
    </div>
</asp:Content>

5) Save it and then place your mouse cursor in between the div's you want to add

6) Then click on Insert on the ribbon, In Webparts category click on Web Part Zone

7) After that webpart zone will look like this

<div id="rightsidebarcontainer">
        <div id="rightsidebar">
<WebPartPages:WebPartZone id="g_14839A89BDA0486CABE9FA1162BAB921" runat="server" title="Zone 1"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone>
        </div>
    </div>

8) Save it. Then your page layout will be created Successfully.

  • Tried but not seems to be working. do I have to add anything to masterpage as well ? – user3639530 Jul 4 '16 at 13:46
  • Actually i have a document which will help you in creating page layout – user51831 Jul 4 '16 at 13:47
  • jsfiddle.net/h5qdwbzc this is my layout body consist of. – user3639530 Jul 4 '16 at 13:51
  • Maybe the edited answer will help you – user51831 Jul 4 '16 at 14:05
  • how would I be adding that layout to my master page. – user3639530 Jul 4 '16 at 14:39
0

For adding web part zone you need to create respective snippets and use it in the html.

You can create a snippet (webpart zone in this case) using design manager.

  • i tried creating those from designer but they are not rendering. like nothing shows up when refreshed. – user3639530 Jul 4 '16 at 13:25
  • I think you read is wrongly. I mean Design Manager and not SharePoint Designer. – Amal Hashim Jul 4 '16 at 13:34
  • yes, I tried that way in design manager add webpart zone and copy the snippet to layout,but i might be doing it wrong or may be it's not working. – user3639530 Jul 4 '16 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.