DEV Community

Samson Adesanoye
Samson Adesanoye

Posted on

1

How to use TinyMCE In Your Custom Voyager View

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:

  1. Create textarea field add the class richTextBox to the textarea. i.e
<textarea  class="form-control richTextBox" name="body" required>
{!!  old('body') !!}
 </textarea> 
Enter fullscreen mode Exit fullscreen mode

Here is an example commit to voyager source code where TinyMCE was implemented and you can draw some ideas from it.

  1. 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));
Enter fullscreen mode Exit fullscreen mode

Source:

List of possible key and value

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs