TinyMCE is an online rich-text editor released as open-source software, its website describe it as the most advanced WYSIWYG HTML editor designed to simplify website content creation. It has the ability to convert HTML textarea fields or other HTML elements to editor instances. It is the default textarea fields editor used in Voyager (The Missing Laravel Admin).
Here are the steps in including TinyMCE in your custom voyager view:
- Create textarea field add the class richTextBox to the textarea. i.e
<textarea class="form-control richTextBox" name="body" required>
{!! old('body') !!}
</textarea>
Here is an example commit to voyager source code where TinyMCE was implemented and you can draw some ideas from it.
- Customize the minimum height of TinyMCE: The default minimum height of TinyMCE in Voyager is 600 in height, and it is represented with the min_height variable.
var additionalConfig = {
min_height: 100,
}
$.extend(additionalConfig, {!! json_encode($options->tinymceOptions ?? '{}') !!})
tinymce.init(window.voyagerTinyMCE.getConfig(additionalConfig));
Source:
Top comments (0)