使用 Adobe Experience Manager 5.6.1 (AEM)(以前称为 CQ5)我正在尝试创建一个类似于页面属性中的图像选项卡的新选项卡。它将被命名为“ Logo ”。
我基本上只是复制图像选项卡来创建 Logo 选项卡并重命名路径以反射(reflect) Logo 目的。例如,我将 fileReferenceParamater
设置为 ./logo/fileReference
并将 requestSuffix
设置为 /logo.img.png
.
当我编辑属性时,我可以像使用“图像”选项卡一样将图像拖到选项卡中,但是,图像永远不会出现在那里。我猜这是因为默认的图像处理程序没有接收到请求。错误是:
Cannot serve request to /content/my-site/home-page/en_us/jcr:content/logo.img.png in org.apache.sling.servlets.get.DefaultGetServlet
当我查看内容节点时,没有 sling:resourceType
。当我添加资源类型 foundation/components/adaptiveimage
时,它就起作用了。但是,我注意到“图像”节点没有 sling:resourceType
。我猜基础页面中的 img.png.java
servlet 正在处理该请求。
我尝试在我的页面组件中创建一个 logo.img.png.jsp
文件来处理请求,但这似乎不起作用。
如何让 AEM 添加 sling:resourceType
或处理请求?
最佳答案
我遇到了类似的问题,但我找到了一种更简单的解决方法。您需要做的就是在您的 logo
图像下添加一个 hidden
xtype,如下所示:
<yourlogo
jcr:primaryType="cq:Widget"
<-- other properties -->
xtype="html5smartimage">
<items jcr:primaryType="cq:WidgetCollection">
<resType
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./logo/sling:resourceType"
value="foundation/components/image"
xtype="hidden"/>
</items>
</yourlogo>
关于页面属性中的 AEM 页面图像不应用吊索 :resourceType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18699233/