0

就像核心中的 Accordion 和 Carousel 组件一样,您可以打开组件对话框并通过单击多字段上的“添加”按钮添加自定义嵌套组件。我正在尝试将此功能添加到我的自定义组件的对话框中。

在我的对话框的 .content.xml 中,我的多字段或子编辑器有这个片段。

<slides
  jcr:primaryType="nt:unstructured"
  sling:resourceType="core/wcm/components/commons/editor/dialog/childreneditor/v1/childreneditor"/>

在这个文件之上,我有

    extraClientlibs=" 
   [my_custom_clientlibs,core.wcm.components.commons.editor.dialog.childreneditor.v1]

问题是当我单击新组件上对话框的添加按钮时,没有弹出任何内容。

我在这里想念什么?

4

1 回答 1

2

我认为您缺少添加sling:resourceSuperType = core/wcm/components/carousel/v1/carousel到自定义组件中的内容。

如果您不想覆盖,请在您的组件 HTL 文件中添加以下代码:

 <sly data-sly-resource="${resource.path @ resourceType='wcm/foundation/components/parsys/newpar', appendPath='/*', decorationTagName='div', cssClassName='new section aem-Grid-newComponent'}"
     data-sly-test="${(wcmmode.edit || wcmmode.preview)}"></sly>

这是因为您在 newpar 中插入了一个子组件。

于 2020-05-22T15:45:25.000 回答