October CMS resources and help articles

Simple and to the point. Optimized by the community.

Use a rich editor form widget as the Rainlab.Blog post editor

5
by mjauvin, last modified on August 4th, 2019

Use the following Event listener to force the RainLab.Blog plugin to always use a richeditor form widget.

Event::listen('backend.form.extendFieldsBefore', function($widget) {
    // Extend only the Blog\Posts controller & Extend only Blog\Post model
    if (!($widget->getController() instanceof \RainLab\Blog\Controllers\Posts
        && $widget->model instanceof \RainLab\Blog\Models\Post)
    ){
        return;
    }

    $widget->secondaryTabs['fields']['content']['type'] = 'richeditor';
});

Discussion

0 comments

We use cookies to measure the performance of this website. Do you want to accept these cookies?