Adobe社区论坛的交叉帖子: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>
我们有一个页面组件(&#34; Blurb&#34;),其中包含此组件作为&#34; featuredImage&#34;,以及&#34; body&#34;允许使用相同组件的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>
如果我在解析器中放置sitename/components/image
组件,我可以将图像从内容查找器拖到组件上进行设置。但是,featuredImage不接受来自内容查找器的拖放操作(&#34;不允许&#34;光标出现,丢弃图像什么都不做)。如果我打开featureImage的编辑对话框,我可以将内容查找器图像拖到那里。我是管理员用户,没有权限限制。
同样的问题适用于为内联编辑配置的文本组件。当文本组件放置在body parsys(或任何parsys)中时,内联编辑器可以正常工作。当文本组件放在parsys之外时(上例中的Page Title),内联编辑器将不会出现。
有趣的是,当我更改Blurb页面组件使用基础组件时,featuresImage 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错误吗?我们的组件是&#39; cq:editConfig定义缺少什么?
编辑:这是在AEM 5.6.1上运行。
我们的图片组件的.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&#39; d /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 <a href="http://slipsum.com/"> Visit Samuel L. Ipsum</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
答案 0 :(得分:1)
由于我没有完整的资源,我只能猜出你实际遇到的问题。我看到以下其中一个可能的原因:
我试图重现这个问题,但没有成功,它对我有用。我为你创建了这个sample project。