【问题标题】:How to configure an attribute to be edited with a RichTextBox editor in SmartEdit?如何在 SmartEdit 中配置要使用 RichTextBox 编辑器编辑的属性?
【发布时间】:2018-10-25 11:04:29
【问题描述】:

我注意到 CMSParagraphComponentcontent 属性可以使用 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

【问题讨论】:

    标签: hybris


    【解决方案1】:

    这可以通过创建下面的 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,重新启动了服务器,一切都按预期工作。 MyTypecustomStringAttribute 现在可以从 smartedit 配置,其方式与 CMSParagraphComponentcontent 完全相同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多