Hi @art_bird
When extending an AEM core component, you typically achieve configuration through a process called "overlays." Here's how to configure the "./includeClasses" property for your custom Table of Contents component:
-
Create a New Component:
- In CRXDE Lite, navigate to your project's
/apps directory.
- Create a folder structure mirroring the core component's path (e.g.,
/apps/yourproject/components/content/toc if the core component is at /libs/foundation/components/toc).
-
Define the Overlay:
- Inside your new component folder (e.g.,
/apps/yourproject/components/content/toc), create a file named .content.xml.
- Within this file, define a node of type
cq:component that inherits from the core component using the sling:resourceSuperType property. Here's an example:
<cq:component xmlns:sling="http://sling.apache.org/sling/sling-content/1.0"
jcr:primaryType="cq:Component"
sling:resourceSuperType="/libs/foundation/components/toc">
</cq:component>
-
Set the "./includeClasses" Property:
- Inside the
cq:component node you created, add a child node of type sling:property. Set the following attributes for this node:
name: Set this to ./includeClasses.
value: Set this to an array of strings representing the class names you want to include (e.g., value="['MyCustomClass1', 'MyCustomClass2']").
Here's the complete example with the "./includeClasses" property:
<cq:component xmlns:sling="http://sling.apache.org/sling/sling-content/1.0"
jcr:primaryType="cq:Component"
sling:resourceSuperType="/libs/foundation/components/toc">
<sling:property name="./includeClasses" value="['MyCustomClass1', 'MyCustomClass2']" />
</cq:component>
- This approach leverages AEM's content repository (CRX) to configure the extended component.
- You don't need to set the property to
"true". The presence of the property with the desired value (the array of class names) is sufficient.
- Remember to activate your changes after saving the
.content.xml file.
Thanks