AEM6 component enabled. Children do not work.

Using AEM6, I want to restrict the type of components in parsys.

  • I have parsys on the page.
  • I drag a custom component from the sidebar onto the parsys page.
  • The custom component also has parses.
  • I can drag sidebar components into my component parses.
  • In the parsys user component, all operations work as expected, drag and drop, drag, reorder, delete.

Using allowed child elements and / or valid parameters in a custom component and child parsys (.content.xml) has no effect, I can not limit the type of components in component parses.

In AEM6, how can I restrict the type of components in parsys?

+6
source share
1 answer

Not sure if this has changed in AEM 6 compared to CQ / AEM 5.X, but you can determine which components are allowed in design mode. If you want this deployment with your code, you can have a definition in xml design:

<?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="cq:Page"> <jcr:content jcr:primaryType="nt:unstructured" jcr:title="My Design" sling:resourceType="wcm/core/components/designer"> <mypagecomponent jcr:primaryType="nt:unstructured"> <par jcr:primaryType="nt:unstructured" sling:resourceType="foundation/components/parsys" components="[group:My Group A]"> <section jcr:primaryType="nt:unstructured"/> <myparcontainer jcr:primaryType="nt:unstructured" <par jcr:primaryType="nt:unstructured" sling:resourceType="project/components/myparsys" components="[group:My Group B]"> <section jcr:primaryType="nt:unstructured"/> </par> </myparcontainer> </par> </mypagecomponent> </jcr:content> </jcr:root> 

The allowedChildren and allowedParents quite difficult to use and cannot be combined. I refused to use them in CQ / AEM 5.X

+2
source

Source: https://habr.com/ru/post/974224/


All Articles