Templates 在iParsys中放置默认零部件

Templates 在iParsys中放置默认零部件,templates,components,aem,Templates,Components,Aem,我们有一组默认的页眉和页脚组件,希望在每个页面上显示 在我的模板文件中,我有如下行自动包含组件: <cq:include path="thecomponent" resourceType="/path/to/component" /> 但是,组件的选项不会继承到子页面,因此我们的用户每次创建新页面时都需要重新生成页眉和页脚。在我的模板文件中,是否有方法自动将这些组件放置在iParsys中 这一尝试没有成功,但我认为它说明了我想做什么: <cq:include path=

我们有一组默认的页眉和页脚组件,希望在每个页面上显示

在我的模板文件中,我有如下行自动包含组件:

<cq:include path="thecomponent" resourceType="/path/to/component"  />

但是,组件的选项不会继承到子页面,因此我们的用户每次创建新页面时都需要重新生成页眉和页脚。在我的模板文件中,是否有方法自动将这些组件放置在iParsys中

这一尝试没有成功,但我认为它说明了我想做什么:

<cq:include path="PageTop" resourceType="/libs/foundation/components/iparsys">   
    <cq:include path="thecomponent" resourceType="/path/to/component"  />  
    <cq:include path="theOthercomponent" resourceType="/path/to/other/component"  />
</cq:include>

我遇到了同样的情况&我找到了这个工作循环解决方案

针对您想要的组件(页眉和页脚),将
cq:noDecoration
设置为
false

<cq:include path="PageTop" resourceType="/libs/foundation/components/iparsys">   
    <cq:include path="thecomponent" resourceType="/path/to/component"  />  
    <cq:include path="theOthercomponent" resourceType="/path/to/other/component"  />
</cq:include>
希望能有帮助

供参考。

似乎是正确的解决方案。在页眉/页脚组件JSP中,您可以这样使用它:

<%
    HierarchyNodeInheritanceValueMap map;
    map = new HierarchyNodeInheritanceValueMap(resource);
%>
...
some inherited property: <%= map.getInherited("myProperty", "") %><br/>
other inherited property: <%= map.getInherited("otherProperty", "") %>

...
某些继承属性:
其他继承财产:
它将尝试从当前资源中获取
myProperty
otherProperty
,如果它们不存在,将使用祖先页面中的适当资源。更多信息可在中找到

<%
    HierarchyNodeInheritanceValueMap map;
    map = new HierarchyNodeInheritanceValueMap(resource);
%>
...
some inherited property: <%= map.getInherited("myProperty", "") %><br/>
other inherited property: <%= map.getInherited("otherProperty", "") %>