HTMLEditorField on frontend


Silverstripe Version: 4.3.2


I’m upgrading a SS3 site to SS4. This site has an area where non-CMS users can write descriptions in rich text.

I cannot find any information on how to get the HTMLEditorField to work on the front-end. Any advice?


Give this a try:

These two will be needed in the controller for the page.


You can add the fields to the form with a standard field method:
HTMLEditorField::create('Content')->setTitle('Content Editor Field'))

And you’ll need to add some JS to initialise the editor, eg:

        selector: 'textarea',
        skin: 'silverstripe',
        max_height: 250,
        menubar: false


legend, works perfectly.

For future reference, you’ll likely want to disable the menu and status bars.

    <script type="text/javascript">
            selector: 'textarea',
            skin: 'silverstripe',
            menubar: false,
            statusbar: false,