SilverStripe HTMLEditorField前端

时间:2015-12-09 16:28:52

标签: php content-management-system silverstripe

我有一个网站,我刚刚使用Multiform模块更新到SS3.2。一切都很好,除了我的HTMLEditorField现在只是前端表单上的textareas。我已经读过,为了在CMS之外使用HTMLEditorField,根据文档需要HTMLEditor_Toolbar:https://docs.silverstripe.org/en/3.2/developer_guides/forms/field_types/htmleditorfield/#using-the-editor-outside-of-the-cms

但是,我使用的是multiform模块,不知道如何集成这两个模块。有没有人有任何想法?

同样设置行数似乎也不起作用。

非常感谢任何帮助。

由于

皮特

代码示例:

<?php

class Gap extends DataObject{

    static $db = array(
        'NotesOnGaps' => 'HTMLText',
    );

    static $has_one = array(
        'CallEvent' => 'CallEvent'
    );

    public function getFrontendFields($params = null){
    $fields = $this->scaffoldFormFields(array(
        'restrictFields' => array(
            'NotesOnGaps',
        ),
        'fieldClasses' => array(
            'NotesOnGaps' => 'HTMLEditorField',
            )
        )
    );

    $fields->push( new HTMLEditorField("NotesOnGaps", "Notes on gaps"));

    return $fields;
    }
}
?>

0 个答案:

没有答案
相关问题