我注意到,可以使用RichTextBox来编辑 CMSParagraphComponent 的 content 属性,如下图所示:
我想用相同的方式(使用所描绘的RichTextBox)编辑自定义属性。我该怎么办?
我尝试将 backoffice-config.xml 配置为使用所见即所得:
<context merge-by="type" type="MyType" component="editor-area" module="moduleBackoffice">
<editorArea:editorArea xmlns:editorArea="http://www.hybris.com/cockpitng/component/editorArea">
<editorArea:tab merge-mode="replace" name="hmc.properties">
<editorArea:section name="hmc.properties">
<editorArea:attribute
editor="com.hybris.cockpitng.editor.localized(com.hybris.cockpitng.editor.wysiwyg)"
qualifier="customStringAttribute"/>
</editorArea:section>
</editorArea:tab>
</editorArea:editorArea>
</context>
但这仅反映在后台,对SmartEdit没有影响。
如何在smartEdit中使用RichTextBox?
混合版本: 6.7.0.3
答案 0 :(得分:0)
这可以通过在Spring bean下面创建来解决:
<bean class="de.hybris.platform.cmsfacades.types.service.impl.DefaultComponentTypeAttributeStructure" p:typecode="MyType" p:qualifier="customStringAttribute">
<property name="populators">
<set>
<ref bean="richTextComponentTypeAttributePopulator" />
<ref bean="requiredComponentTypeAttributePopulator" />
</set>
</property>
</bean>
我在我的 $ {extensionname} -spring.xml 中添加了上面定义的bean,重新启动了服务器,一切正常。现在,可以通过smartedit配置 MyType 的 customStringAttribute ,该方法与 CMSParagraphComponent 的内容完全相同。