首页 > 解决方案 > Hybris 后台:WYSIWYG 中的图像配置不起作用

问题描述

我试图允许在Product描述中插入图像。我在 help.hybris.com 上关注了官方文档。出现功能图标Add image。我可以上传图片,但图片未显示在前端页面 ( Product detail page) 上。它在后台描述字段中可见,因此已保存。

我还尝试按照同一手册中的建议启用 base64encoding,但没有帮助。进行这些更改后,我确实运行了ant clean all,重新启动了 hybris 服务器并REDEPLOY在后台运行。

这是我的custom-backoffice-config.xml文件

  <context merge-by="type" parent="GenericItem" type="Product" component="editor-area">
        <editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
            <editorArea:tab name="hmc.tab.product.properties">
                <editorArea:section name="hmc.product.descriptions">
                        <editorArea:attribute editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.wysiwyg)" qualifier="description" merge-mode="replace">
                            <editorArea:editor-parameter>
                                <editorArea:name>base64Encoded</editorArea:name>
                                <editorArea:value>true</editorArea:value>
                            </editorArea:editor-parameter>
                        </editorArea:attribute>
                        <editorArea:attribute qualifier="summary" merge-mode="remove"/>
                </editorArea:section>
            </editorArea:tab>
...

看起来启用base64编码对我不起作用,但我看不出那里有什么问题。

我在用着Hybris ver. 1811

标签: javawysiwyghybrisbackoffice

解决方案


原来在前端有一个函数可以过滤掉每个 html 标签。
所以我不得不改变它

${ycommerce:sanitizeHTML(product.description)}

对此

${product.description}

推荐阅读