I'm provisioning a bunch of Publishing pages using a feature, using the template redirection technique.
<Module Name="Page-Not-Found" Url="$Resources:cmscore,List_Pages_UrlName;">
<File Url="Page-Not-Found.aspx" Path="Root\template.aspx" Type="GhostableInLibrary">
<Property Name="Title" Value="Page Not Found"/>
<Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/MyPageLayout.aspx, My Page Layout Name" />
<Property Name="ContentType" Value="My Content Type Name" />
</File>
</Module>
The pages are provisioned correctly:
- The Title property is set correctly
- The page is created using the appropriate page layout and is bound to the correct content type
- It's not shown here, but I can also use
AllUsersWebPart
to provision web parts onto the page
The problem I'm having is that I'm unable to populate the Html fields on the page with content; for example, by adding a property like:
<Property Name="PageContent1" Value="<h1>Page Not Found</h1><p>Sorry, that page doesn't exist.</p>"/>
I tried some alternate syntax, such as:
<Property Name="PageContent1">
<![CDATA[<h1>Page Not Found</h1><p>Sorry, that page doesn't exist.</p>]]>
</Property>
but that didn't work either. The field PageContent1 is always empty, and I see no errors in the logs.
I only see this issue for HTML fields like PageContent1. I'm using the same technique to set the value of a Lookup Column and Note field on the page and have no problems there.
Is anybody using this technique to provision Publishing pages and populate them with content?
Thank you