0

I have created a page layout using design manager in Sharepoint and have created a webpart zone using design manager. This all working fine. Now for some reason I want to add a webpart (Content Editor Webpart) into the page layout itself. I tried the following approaches but they have not worked for me.

I tried to copy the content editor webpart snippet from design manager and pasted into the below code at 11 , 22 , 33 locations but when I render it, the webpart does not appear in the resulting .ASPX page.

Any suggestions will be helpful.

            <div class="work">
            <div data-name="WebPartZone">
                <!--CS: Start Web Part Zone Snippet-->
                <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                <div xmlns:ie="ie">
                    <!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="xae124c535eba449ca25785965e290373" FrameType="TitleBarOnly" Orientation="Vertical">-->
                    <!--MS:<ZoneTemplate>-->
                    11 <!--DC: Replace this comment with default web parts for new pages. -->
                    <!--ME:</ZoneTemplate>-->
                    22 <!--ME:</WebPartPages:WebPartZone>-->
                </div>                    
                33 <!--CE: End Web Part Zone Snippet-->
            </div>
        </div>
0

I solved it. The solution was to place the webpart snippet (e.g. content editor webpart HTML snippet) at the line 11 of my below mentioned code. It had tried it earlier but it did not worked on the existing page layout.

Then by referencing some other community posts I came to know that it works with only new page layouts. So, finally I created a new page layout and replaced the line 11 with webpart HTML snippet and it worked.

 <div class="work">
        <div data-name="WebPartZone">
            <!--CS: Start Web Part Zone Snippet-->
            <!--SPM:<%@Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
            <div xmlns:ie="ie">
                <!--MS:<WebPartPages:WebPartZone runat="server" AllowPersonalization="false" ID="xae124c535eba449ca25785965e290373" FrameType="TitleBarOnly" Orientation="Vertical">-->
                <!--MS:<ZoneTemplate>-->
                11 <!--DC: Replace this comment with default web parts for new pages. -->
                <!--ME:</ZoneTemplate>-->
                22 <!--ME:</WebPartPages:WebPartZone>-->
            </div>                    
            33 <!--CE: End Web Part Zone Snippet-->
        </div>
    </div>

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.