concrete5, being a content management system, comes with built-in What You See Is What You Get (WYSIWYG) editors, specifically, a popular open source editor called TinyMCE. Developers can include this editor in their custom HTML forms. In this recipe, we will add a WYSIWYG editor to the form that we created in the previous recipe.
We will be building upon the form that was created in the previous recipe. The free code download from this book's website will give you a good starting point if you need to catch up.
Open
/single_pages/example_form.php
.At the top of the file, include the JavaScript element to initialize the editor:
Loader::element('editor_init');
Below that, include the default TinyMCE configuration element:
Loader::element('editor_config');
Above the existing textarea output, load the element containing the editor's controls:
Loader::element('editor_controls');
Replace the existing textarea output with a new one:
echo ...