1

Followed this instruction and managed to create a custom placeholder in my master page. But it would not allow me to add any web part in the site column I placed within the custom placeholder.

In master page:

<div id="mainfooter">
<!--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-->
</div>

In Page Layout, I added the following above </mso:CustomDocumentProperties>:

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

In Page Layout, I added the HTML snippet for the new site column (with Publishing HTML format) after <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderUtilityContent" runat="server">-->. I can type any text but each time I insert a web part, it would look like this: enter image description here

But if I move the web part in placeholdermain area - it appears as normal. Below image is just to show how the site column accepts web parts if placed in placeholdermain but not when inserted in any custom placeholders. enter image description here

  • Did you add a web part zone? Web parts go into web part zones, which can then be in the custom content placeholder. docs.microsoft.com/en-us/sharepoint/dev/general-development/… – Heather Solomon Sep 12 '18 at 22:10
  • Thanks but yes, I added a web part zone on another custom placeholder. I was hoping to give content providers another 'placeholdermain' with page content column where they can also insert any text, images, and web part. – Tamras Merin Sep 12 '18 at 23:08
  • I will be honest, this would be infinitely easier if you move out of using Design Manager, at least for your page layouts. The added snippets makes the whole process convoluted and overly complicated. – Heather Solomon Sep 13 '18 at 14:11
0

If you are willing to drop Design Manager, you can create your page layouts this way. You can use this article to help with some screenshots: https://www.c-sharpcorner.com/article/steps-to-create-page-layouts-in-sharepoint-2013-using-sharepoint-designer/

  1. Use SharePoint Designer if possible - it makes the process go a lot faster.
  2. Create a custom content type if desired for your page.
  3. Create a new page layout file in SharePoint Designer and you will be prompted to pick a content type. Select your custom one or choose and OOTB content type, like Article Page.
  4. Add a custom content control which references your custom content placeholder. It would look like this:

<asp:Content ContentPlaceholderID="PlaceHolderUtilityContent" runat="server"> 
</asp:Content>

  1. Add field controls inside of the content control. This will be where you provide people the ability to add text, images and web parts. Look for Page Content under Content Fields.
  2. Save and publish the file.

Here is an example of what a completed code block would look like:

<asp:Content ContentPlaceholderID="PlaceHolderUtilityContent" runat="server"> 
    <PublishingWebControls:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server"></PublishingWebControls:RichHtmlField>
</asp:Content>
0

Old post, but answering to help those who may come into the same issue. I had the same issue. Created a new site column of Publishing HTML format and wanted to add another area on a page/page layout that people could add more text/HTML/or web parts.

Received same errors as above.

It seems that you MUST put these fields inside the PlaceholderMain area.

Workaround: Add any custom placeholders you need INSIDE the PlaceholderMain Placeholder.

<div data-name="ContentPlaceHolderMain">
<!--CS: Start PlaceHolderMain Snippet-->
<!--SPM:<%@Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
<!--MS:<SharePoint:AjaxDelta ID="DeltaPlaceHolderMain" IsMainContent="true" runat="server">-->
    <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderMain" runat="server">-->

        <div class="container">
            <!-- sets to a certain width -->
            <!--CS: Start PlaceHolderMainContent Snippet-->
            <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderMainContent" runat="server">-->
            <!--ME:</asp:ContentPlaceHolder>-->
            <!--CE: End PlaceHolderMainContent Snippet-->
        </div>

        <!--CS: Start PlaceHolderUnconstrainedAdditionalPageContent Snippet-->
        <!--MS:<asp:ContentPlaceHolder ID="PlaceHolderUnconstrainedAdditionalPageContent" runat="server">-->
        <!--ME:</asp:ContentPlaceHolder>-->
        <!--CE: End PlaceHolderUnconstrainedAdditionalPageContent Snippet-->

    <!--ME:</asp:ContentPlaceHolder>-->
<!--ME:</SharePoint:AjaxDelta>-->
<!--CE: End PlaceHolderMain Snippet-->
</div>

The data-name div and the AjaxDelta seem to be important when it comes to where the web part properties pane shows when you edit a web part. LEAVE THESE IN. When I removed them the page would add the web part properties pane off screen.

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.