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,
1 Like

How I enable image upload in the editor in the frontend?

I think a lot of the popup buttons need the rest of the CMS to work properly.
The way I’ve gotten around it in the past is having separate UploadFields for images

My requirement is to edit html content through frontend…images can be placed anywhere in the content…so I can’t have a seperate upload field…

If are able to upload a image through upload field then should be a way to upload through content editor…