如何在 SmartEdit 中配置要使用 RichTextBox 编辑器编辑的属性?
How to configure an attribute to be edited with a RichTextBox editor in SmartEdit?
我注意到 CMSParagraphComponent 的 content 属性可以使用如下图所示的 RichTextBox 进行编辑:
我想以相同的方式(使用描述的 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?
Hybris 版本:6.7.0.3
这可以通过创建以下 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,重新启动了服务器,一切正常预期的。 MyType 的 customStringAttribute 现在可以从 smartedit 配置,其方式与 CMSParagraphComponent 的 内容是.
我注意到 CMSParagraphComponent 的 content 属性可以使用如下图所示的 RichTextBox 进行编辑:
我想以相同的方式(使用描述的 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?
Hybris 版本:6.7.0.3
这可以通过创建以下 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,重新启动了服务器,一切正常预期的。 MyType 的 customStringAttribute 现在可以从 smartedit 配置,其方式与 CMSParagraphComponent 的 内容是.