页面属性中的AEM页面图像不应用sling:resourceType

jed*_*atu 3 aem

使用Adobe Experience Manager 5.6.1(AEM)(以前称为CQ5)我正在尝试创建一个类似于"页面属性"中"图像"选项卡的新选项卡.它将标题为"徽标".

我基本上只是复制了"图像"选项卡以创建徽标选项卡,并重命名路径以反映徽标的用途.例如,我设置了fileReferenceParamaterto ./logo/fileReferencerequestSuffixto /logo.img.png.

当我编辑属性时,我可以像使用"图像"选项卡一样将图像拖到选项卡中,但是,图像永远不会出现在那里.我猜这是因为默认图像处理程序没有提取请求.错误是:

无法向org.apache.sling.servlets.get.DefaultGetServlet中的/content/my-site/home-page/en_us/jcr:content/logo.img.png提出请求

当我查看内容节点时,没有sling:resourceType.当我添加资源类型foundation/components/adaptiveimage然后它工作.但是,我注意到"图像"节点没有sling:resourceType.我想img.png.java基础页面中的servlet正在处理该请求.

我尝试logo.img.png.jsp在我的页面组件中创建一个文件来处理请求,但这似乎不起作用.

如何让AEM添加sling:resourceType或处理请求?

Tua*_*uan 5

我遇到了类似的问题,我发现了一种更简单的解决方法.您需要做的就是hiddenlogo图片下添加一个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>
Run Code Online (Sandbox Code Playgroud)