2

I'm struggling to find a walkthrough that shows me how to do this in SP2013.

I am using the html-generated master page to do edits.

I tried the snippit generator and SP Designer but with no luck :(

Please help.

3

You have to switch to an ASP.net master page. All placeholder that are unknown to SharePoint will be removed during the conversation from the html master page to the asp.net master page.

The registration can be done using the following tags:

<asp:ContentPlaceHolder id="NewPlaceHolder" runat="server">
</asp:ContentPlaceHolder>
1
  • I know this is old, but it came up for me searching so just in case someone needs it...you can add it to your html master page, you just need to do it as a snippet of custom asp and it ends up something like: <!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet--> <!--SPM:<asp:ContentPlaceHolder id="NewPlaceHolder" runat="server" Visible="false"/>--> <!--CE: End Create Snippets From Custom ASP.NET Markup Snippet--> – andrewf Jan 17 '18 at 0:43
1

I found an article with a successful solution for this! The article is from one Ben Haynes. Here's the link and the text from his post. It works for me.

http://sharepointinguniverse.blogspot.com/2013/11/contentplaceholders-and-sharepoint-2013.html

Having problems today working with overriding ContentPlaceHolders in the brave new world of HTML and Master Pages/Page Layouts. Firstly how to add the content place holder into the Master Page into a place that SharePoint will utilise it and not put it into the bottom of the page.

To do this you need to add the following to the HTML Master Page in the HTML where you want the PlaceHolder to sit:

<!--CS: Start PlaceHolderUtilityContent Snippet-->
<!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
<!--MS:<SharePoint:AjaxDelta ID="DeltaPlaceHolderUtilityContent" runat="server">-->
<!--MS:<asp:ContentPlaceHolder ID="PlaceHolderUtilityContent" runat="server">-->
<!--ME:</asp:ContentPlaceHolder>-->
<!--ME:</SharePoint:AjaxDelta>-->
<!--CE: End PlaceHolderUtilityContent Snippet-->

SharePoint will recognise this and not put the ContentPlaceHolder as empty at the bottom.

So how do you add content into this in your HTML page layout. Just add an override right? e.g.

<!--MS:<asp:ContentPlaceHolder ID="PlaceHolderUtilityContent" runat="server">-->
<div>someothercontent</div>
<!--ME:</asp:ContentPlaceHolder>-->

Well this will not work. What you have to do is tell the page that the ContentPlaceHolder is being utilised in the Page Layout. This is done in the sections. You need to add two properties firstly (Below the equalivant for Place Holder Main):

<mso:ContentPlaceHolderHashPlaceHolderUtilityContent msdt:dt="string">1</mso:ContentPlaceHolderHashPlaceHolderUtilityContent>

Secondly:

<mso:ContentPlaceHolderChangedPlaceHolderUtilityContent msdt:dt="string">True</mso:ContentPlaceHolderChangedPlaceHolderUtilityContent>

Now your override will work!

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.