cq:editConfig 不在 parsys 之外应用

cq:editConfig not applying outside of parsys

Cross-post 来自 Adob​​e 社区论坛:http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__qugo-we_have_an_imagecom.html

我们有一个图片组件,它的_cq_editConfig.xml是:

<?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"
    cq:disableTargeting="{Boolean}true"
    jcr:primaryType="cq:EditConfig">
    <cq:dropTargets jcr:primaryType="nt:unstructured">
        <image
            jcr:primaryType="cq:DropTargetConfig"
            accept="[image/.*]"
            groups="[media]"
            propertyName="./fileReference">
        </image>
    </cq:dropTargets>
</jcr:root>

我们有一个页面组件 ("Blurb"),其中包括此组件作为 "featuredImage",还有一个 "body" parsys,它允许使用相同的组件:

<div>
  <h1>*Page Title</h1>
  <cq:include path="pageTitle" resourceType="sitename/components/plainText"/>
</div>

<div>
  <h1>*Featured Image</h1>
  <cq:include path="featuredImage" resourceType="sitename/components/image"/>
</div>

<div>
  <h1>*Body</h1>
  <cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>

如果我在 parsys 中放置一个 sitename/components/image 组件,我可以将图像从内容查找器拖到组件上以进行设置。然而,featuredImage 将不接受来自内容查找器的 drag-n-drop("not allowed" 光标出现,放下图像没有任何作用)。如果我打开 featureImage 的编辑对话框,我可以将内容查找器图像拖到那里。我是admin用户,没有权限限制

同样的问题适用于为内联编辑配置的文本组件。当文本组件放置在 body parsys(或任何 parsys)中时,内联编辑器工作。当文本组件放在 parsys 之外时(上例中的页面标题),内联编辑器将不会出现。

有趣的是,当我将 Blurb 页面组件更改为使用基础组件时,featuredImage drag-n-drop 起作用,但 pageTitle 内联编辑不起作用。

<div>
  <h1>*Page Title</h1>
  <cq:include path="pageTitle" resourceType="foundation/components/text"/>
</div>

<div>
  <h1>*Featured Image</h1>
  <cq:include path="featuredImage" resourceType="foundation/components/image"/>
</div>

<div>
  <h1>*Body</h1>
  <cq:include path="body" resourceType="sitename/components/page/blurb/parsys"/>
</div>

这是 WCM 错误吗?我们的组件的 cq:editConfig 定义是否遗漏了什么?


编辑:这是 AEM 5.6.1 上的 运行。

我们的Image组件的.content.xml:

<?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"
    jcr:primaryType="cq:Component"
    jcr:title="Image (Custom)"
    sling:resourceSuperType="foundation/components/image"
    allowedParents="[*/parsys]"
    componentGroup="Site Name Group"/>

和dialog.xml:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Dialog"
    xtype="tabpanel">
    <items jcr:primaryType="cq:WidgetCollection">
        <advanced
            jcr:primaryType="cq:Widget"
            path="/apps/sitename/components/image/tab_advanced.infinity.json"
            xtype="cqinclude"/>
        <image
            jcr:primaryType="cq:Widget"
            path="/apps/sitename/old/components/image/dialog/items/image.infinity.json"
            xtype="cqinclude"/>
    </items>
</jcr:root>

和 cqinclude 的 /apps/sitename/components/image/tab_advanced.infinity.json

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
    jcr:primaryType="cq:Panel"
    title="Advanced">
    <items jcr:primaryType="cq:WidgetCollection">
        <image
            jcr:primaryType="cq:Widget"
            collapsed="{Boolean}false"
            collapsible="{Boolean}true"
            title="Image"
            xtype="dialogfieldset">
            <items jcr:primaryType="cq:WidgetCollection">
                <title
                    jcr:primaryType="cq:Widget"
                    allowBlank="{Boolean}false"
                    fieldDescription="Required Field: If the Alt Text field is left blank, the image title will be used instead. "
                    fieldLabel="Image Title"
                    maxLength="{Long}60"
                    name="./jcr:title"
                    xtype="textfield"/>
                <linkUrl
                    jcr:primaryType="cq:Widget"
                    fieldDescription="Optional Field: use the link field to specify where the image ought to link to."
                    fieldLabel="Link to"
                    name="./linkUrl"
                    regex="/^\S*$/"
                    regexText="Please enter a valid link"
                    xtype="pathfield"/>
                <alt
                    jcr:primaryType="cq:Widget"
                    fieldDescription="Optional Field: When text is entered into the Alt text field it will be used instead of the image Title. If the image is used as a link, the Alt text is used for the name of the link. For example &lt;a href=&quot;http://slipsum.com/&quot;> Visit Samuel L. Ipsum&lt;/a>"
                    fieldLabel="Alt Text"
                    maxLength="{Long}100"
                    name="./alt"
                    xtype="textfield"/>
                <description
                    jcr:primaryType="cq:Widget"
                    fieldDescription="Optional Field: used to populate the image caption"
                    fieldLabel="Caption"
                    maxLength="{Long}256"
                    name="./jcr:caption"
                    xtype="textarea"/>
            </items>
        </image>
    </items>
</jcr:root>

和/apps/sitename/old/components/image/dialog/items/image.infinity.json

<image
            jcr:primaryType="cq:Widget"
            allowUpload="{Boolean}false"
            ddGroups="[media]"
            fileNameParameter="./fileName"
            fileReferenceParameter="./fileReference"
            name="./file"
            requestSuffix=".img.png"
            title="Image"
            xtype="html5smartimage"/>

用于测试的示例包(带有文本组件内联编辑)位于:http://s000.tinyupload.com/index.php?file_id=05420490884931180108

由于我没有完整的源代码,所以我只能猜测您实际遇到的是哪个问题。我认为可能是以下原因之一:

  1. 您要么没有提供 CQ 编辑器 类 here
  2. 您的自定义 parsys 配置错误,请尝试将其替换为基础 parsys。

我试图重现这个问题,但没有成功,它对我有用。我为你创建了这个 sample project