首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >AEM6组件allowedChildren不工作

AEM6组件allowedChildren不工作
EN

Stack Overflow用户
提问于 2014-08-22 16:25:00
回答 1查看 2.7K关注 0票数 6

使用AEM6,我希望限制parsys中组件的类型。

  • 我在一页中有一个parsys。
  • 我将自定义组件从侧栏拖到parsys页面。
  • 自定义组件还具有一个parsys。
  • 我可以将侧栏组件拖到组件parsys中。
  • 在自定义组件parsys中,所有操作都按预期工作,拖放、重新排序、删除。

在自定义组件中使用allowedChildren和/或allowedParents和子parsys (.content.xml)没有任何影响,因此不能限制组件parsys中的组件类型。

在AEM6中,如何限制parsys中组件的类型?

EN

回答 1

Stack Overflow用户

发布于 2014-08-25 07:00:18

不确定与CQ/AEM 5.X相比,AEM 6中的情况是否发生了变化,但是您可以在设计模式中定义哪些组件是允许的。如果希望在代码中部署此定义,则可以在设计xml中获得定义:

代码语言:javascript
运行
复制
<?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>

allowedChildrenallowedParents过滤器的使用非常复杂,不能组合在一起。我放弃了在CQ/AEM 5.X中使用它们

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25451560

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档