限制AEM 5.6.1中的组件

Mor*_*ais 10 aem

如何限制AEM 5.6.1中可以在模板的特定分析中使用而不在设计模式中选择它们的组件?

ano*_*ave 13

在CRXDE中,/etc/designs/[your design]/jcr:content您可以定义节点来表示每个模板及其段落,并列出每个模板允许的组件.

格式是每个模板的节点,其中包含每个parsys(两者[nt:unstructured])的节点.

所述parsys节点然后有一个sling:resourceType限定的foundation/components/parsyscomponents的特性String[].例如,查看Geometrixx如何定义:http://localhost:4502/crx/de/index.jsp#/etc/designs/geometrixx/jcr%3Acontent/contentpage/par

然后,您可以通过VLT提取此信息,VLT将存储为.content.xml文件etc/designs/[your design].

或者,您也可以手动创建该文件.例如,以下内容将"Your Design"定义为允许"yourTemplate"的"yourParsys"段落上的默认"text"和"image"组件.

<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
      cq:template="/libs/wcm/core/templates/designpage"
      jcr:primaryType="cq:PageContent"
      jcr:title="You Design">
        <yourTemplate jcr:primaryType="nt:unstructured">
            <yourParsys
              jcr:primaryType="nt:unstructured"
              sling:resourceType="foundation/components/parsys"
              components="[foundation/components/text,foundation/components/image]"/>
        </yourTemplate>
    </jcr:content> 
</jcr:root>
Run Code Online (Sandbox Code Playgroud)

这允许您跨实例移动此文件(例如,在部署CRX包时),这样您就不必单独配置环境以及允许哪些组件也可以通过版本控制进行管理.