Customizing the metadata fields for the Page Properties is a common requirement in any Sites implementation. This video details the most effective way to accomplish this using features of the Sling Resource Merger.

The above video shows customizing the page properties for the We.Retail application in AEM 6.3 using various features of the Sling Resource Merger. It enables the following customizations:

  • Custom textfield on Basic tab.
  • Custom Tab inserted after Basic tab.
  • Hides Permissions tab.

Note:

If using versions of AEM older than 6.3 the same Sling Resource Merger features can be used. However instead of the Core Components Page dialog it will be the Foundation Page dialog that will be customized. The path to the to the foundation dialog:

  • /libs/foundation/components/page/cq:dialog (JSP)
  • /libs/wcm/foundation/components/page (HTL)

Download

Below is an XML representation of the cq:dialog inserted beneath /apps/weretail/components/structure/page/cq:dialog

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:primaryType="nt:unstructured">
    <content jcr:primaryType="nt:unstructured">
     <items jcr:primaryType="nt:unstructured">
      <tabs jcr:primaryType="nt:unstructured">
       <items
         jcr:primaryType="nt:unstructured"
         sling:hideChildren="permissions">
         <basic jcr:primaryType="nt:unstructured">
          <items jcr:primaryType="nt:unstructured">
           <column jcr:primaryType="nt:unstructured">
            <items jcr:primaryType="nt:unstructured">
             <title jcr:primaryType="nt:unstructured">
               <items jcr:primaryType="nt:unstructured">
                <customfield
                  cq:showOnCreate="{Boolean}true"
                  jcr:primaryType="nt:unstructured"
                  sling:orderBefore="tags"
                  sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                  fieldLabel="Custom Field"
                  name="./customfield"
                  renderReadOnly="{Boolean}true"/>
                 </items>
                </title>
              </items>
            </column>
            </items>
            </basic>
            <custom
             jcr:primaryType="nt:unstructured"
             jcr:title="Custom"
             sling:orderBefore="advanced"
             sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
             <items jcr:primaryType="nt:unstructured">
              <column
                jcr:primaryType="nt:unstructured"
                sling:resourceType="granite/ui/components/coral/foundation/container">
               <items jcr:primaryType="nt:unstructured">
                 <fieldset
                   jcr:primaryType="nt:unstructured"
                   jcr:title="Custom Field Set"
                   sling:resourceType="granite/ui/components/coral/foundation/form/fieldset"/>
                </items>
              </column>
             </items>
             </custom>
            </items>
  </tabs>
  </items>
 </content>
</jcr:root>

Supporting Material

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy