5

I am working with a company that has supplied the branding I am using to create my master page. I have successfully imported and converted this with most of my content appearing in the

  <div class="ContentPlaceHolderMain".

Now I want to move the OOTB search box to my custom header / menu bar as show below..

enter image description here

Do I do this in my custom_master.html as in place ContentPlaceHolderMain above the markup for the custom header / menu bar. I would need to put a web part zone here. Alternatively, should I really be looking at editing the welcome.html layout page I am using for welcome.aspx, the my publishing site.

1 Answer 1

10

You can copy any of the existing MasterPage's html file (I hope you have already figured that out) and go to Site Settings -> Design Manager -> Edit Master Page

Now click your copied MasterPage and at the top-right you can see Snippets.. This is newly introduced in SharePoint 2013 and further explained here

Now if you click Search Box, this will give you Search script that you can add to your HTML MasterPage so that SharePoint when converting to .master file can know you meant a Search Box here, the screen will look like below:

Snippet Gallery - SharePoint 2013

You can copy the HTML Snippet to put in your HTML file.. About adding Web Part zones, you can do that in SharePoint Designer.. Or simply paste this code, where you want a Web Part Zone:

<div data-name="WebPartZone">
   <!--CS: Start Web Part Zone Snippet-->
   <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
   <div xmlns:ie="ie">
      <!--MS:<WebPartPages:WebPartZone runat="server" ID="x0e5f5212505f48a9aac43df13eeae4f9" AllowCustomization="True" AllowPersonalization="False" FrameType="TitleBarOnly" LockLayout="True" Orientation="Vertical">-->
          <!--MS:<ZoneTemplate>-->

          <!--ME:</ZoneTemplate>-->
      <!--ME:</WebPartPages:WebPartZone>-->
  </div>
   <!--CE: End Web Part Zone Snippet-->
</div>

Source: Web Part Zone Snippet

6
  • Yep that did it! Had looked at snippets and noticed the search snippet but it was the lack of web part zone that confused me ... I am must sorting out the styles so that it isn't blue foreground text or blue background and am also changing the default scope to People I noticed you also answered my second question and I markup a web part zone with a similar snippet insert. This a lot more fun that the old v4.master days Commented Feb 12, 2014 at 13:15
  • Yeah, Design Manager is cool.. It was frustrating at the beginning but had to go with the flow.. Please mark the answer if it was helpful to close the Question :) Commented Feb 12, 2014 at 13:19
  • @ArsalanAdamKhatri Could I use this to add a advanced search to master page ? I export the advanced search webpart, and then upload it to library in the site. If I deploy my master page, a error message will appear "One of the properties of the Web Part has an incorrect format. Microsoft SharePoint Foundation cannot deserialize the Web Part. Check the format of the properties and try again. "
    – AnnaCICI
    Commented May 5, 2015 at 11:40
  • @MKQian Is the advanced search web part a custom web part that you built? Commented May 5, 2015 at 18:29
  • @ArsalanAdamKhatri It is a web part in site search center, I export it and then upload it to library in the site. I must use the web part by default ?
    – AnnaCICI
    Commented May 6, 2015 at 13:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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