How to update a page template's initial page properties through code?
The project code has a property called contentType set under the following path
/conf/<project>/settings/wcm/templates/<template_name>/initial/jcr:content
I am trying to update the value of the contentType but the changes are not getting updated in the aem instance after deploying the project in aem cloud.
Below is the initial page properties code for the template in the project before and after updating the contentType property:
Before:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root jcr:primaryType="cq:Page">
<jcr:content cq:template="<template_path>"
jcr:primaryType="cq:pageContent"
sling:resourceType="<page_component_path"
contentType="article">
</jcr:content>
</jcr:root>
After:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root jcr:primaryType="cq:Page">
<jcr:content cq:template="<template_path>"
jcr:primaryType="cq:pageContent"
sling:resourceType="<page_component_path"
contentType="">
</jcr:content>
</jcr:root>
Is there any way to update the contentType property in a template's initial page properties?