Hello,
does anyone have an example how to use the HtmlEditorField like in the CMS? What are the requirements and how is the field defined and initialized?
Thanks and Greetings
Michael
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hello,
does anyone have an example how to use the HtmlEditorField like in the CMS? What are the requirements and how is the field defined and initialized?
Thanks and Greetings
Michael
Create an HtmlEditorField in your form and that should include all the javascript required for the field (at least in 2.4 it does).
http://api.silverstripe.org/3.0/forms/fields-formattedinput/HtmlEditorField.html
Since I'm Ajax loading the form fields the trick was to require the JS files at initial page load and reinitialize the html editor fields after a complete Ajax call.