I have created a custom page layout by copying an existing one and then adding the HTML code inside the code below, and then uploading the resulting .aspx file into the layouts folder:
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server"> HTML code here - tables, pictures etc. </asp:Content>
It works fine, but the problem is that I want to allow users to add web parts into this page by clicking "Edit" in the SharePoint web interface and clicking "Web Parts" on the ribbon.
However, it seems that the entire page is read only. You cannot add modify any text and cannot insert any webparts. Nothing happens when you try to click any area of the page.
I've tried inserting this (found on MSDN) but it didn't help, this section still appears read only in page edit mode:
<!-- webpart zone --> <div data-name="WebPartZone"> <div xmlns:ie="ie"> Webpart zone is here </div> </div>
I've tried searching but all articles seem to talk about something completely irrelevant, creating page layouts using GUI inside SharePoint, or allowing users to input field values.
So the question is, how do I allow users to add webparts into the custom layout that I've made?
UPDATE: I've managed to add an editable area into the page by adding this code (and I can insert the web part there):
<PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" MinimumEditHeight="200px" runat="server"/>
The webpart displays fine while in the edit mode.
However, when I save the page and leave the edit mode, the web part disappears.