要求是,在一个新的组件对话框中,我需要标签包含两个通用 CTA 配置,例如:
目前,我的新组件对话框设置如下:
<tab3
jcr:description="Primary CTA items"
jcr:primaryType="nt:unstructured"
jcr:title="Primary CTA"
granite:class="tab-wrapper"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<columns
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<cta
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/include"
path="myproject/folder/components/commons/cta/content/items/columns/items/column"/>
</items>
</column>
</items>
</columns>
</items>
</tab3>
<tab4
jcr:description="Secondary CTA items"
jcr:primaryType="nt:unstructured"
jcr:title="Secondary CTA"
granite:class="tab-wrapper"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<columns
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"
margin="{Boolean}true">
<items jcr:primaryType="nt:unstructured">
<column
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container">
<items jcr:primaryType="nt:unstructured">
<cta2
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/include"
name="./cta2/"
path="myproject/folder/components/commons/cta/content/items/columns/items/column"/>
</items>
</column>
</items>
</columns>
</items>
</tab4>
如您所见,我正在使用sling:resourceType="granite/ui/components/coral/foundation/container"
指向通用 cta 对话框配置path="myproject/folder/components/commons/cta/content/items/columns/items/column"
问题是,在我构建它之后,在 crx/de 中,我只能看到一个节点对象:
如您所见,如果我使用 sling 资源包含包含 CTA diagloc,它总是给我对象名称 CTA,并且它是重复的,因此新组件中的选项卡 3 和选项卡 4 对话框配置会覆盖彼此的值。
我想知道以前有人遇到过这个问题吗?什么是最好的解决方案?一些编码示例会有所帮助谢谢