使用AEM6,我希望限制parsys中组件的类型。
在自定义组件中使用allowedChildren和/或allowedParents和子parsys (.content.xml)没有任何影响,因此不能限制组件parsys中的组件类型。
在AEM6中,如何限制parsys中组件的类型?
发布于 2014-08-25 07:00:18
不确定与CQ/AEM 5.X相比,AEM 6中的情况是否发生了变化,但是您可以在设计模式中定义哪些组件是允许的。如果希望在代码中部署此定义,则可以在设计xml中获得定义:
<?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>
allowedChildren
和allowedParents
过滤器的使用非常复杂,不能组合在一起。我放弃了在CQ/AEM 5.X中使用它们
https://stackoverflow.com/questions/25451560
复制相似问题