Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to show classic wysiwyg editor, not markdown? #112

Closed
vojtasvoboda opened this issue Aug 11, 2015 · 9 comments

Comments

@vojtasvoboda
Copy link
Contributor

commented Aug 11, 2015

How to show classic wysiwyg editor instead of markdown editor? My clients don't know anything about markdown and trying to edit post in 'preview' area at the right side.

They want to edit content in same way as staticPage pages.

@gergo85

This comment has been minimized.

Copy link
Contributor

commented Aug 18, 2015

You should try to the Wysiwyg Editors plugin.

@vojtasvoboda

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2015

Yes, I tried it as first solution, but it doesn't work :-(

snimek obrazovky 2015-08-19 v 11 03 40

snimek obrazovky 2015-08-19 v 11 05 11

@robertsamurai

This comment has been minimized.

Copy link

commented Aug 20, 2015

Turning on "Use for RainLab Blog" doesn't work for me either, continues to use Markdown editor. Markdown editor doesn't have options to insert Audio or Video using the Media Manager feature, so I prefer to use October's Rich Editor for posts.

@vojtasvoboda

This comment has been minimized.

Copy link
Contributor Author

commented Aug 21, 2015

There is two way how to turn on Rich editor:

  1. Edit /plugins/rainlab/blog/models/post/fields.yaml - rewrite RainLab\Blog\FormWidgets\BlogMarkdown to richeditor. BUT you lose it with first plugin update.

  2. Better way, but little bit complicated - create own plugin (My.Site, or My.BlogBetter) and in Plugin.php add:

    public function boot()
    {
        // Extend all backend form usage
        Event::listen('backend.form.extendFields', function($widget) {

            // Extend only the Blog\Posts controller
            if (!$widget->getController() instanceof \RainLab\Blog\Controllers\Posts)
                return;

            // Extend only Blog\Post model
            if (!$widget->model instanceof \RainLab\Blog\Models\Post)
                return;

            // Update content field
            $widget->addSecondaryTabFields([
                'content' => [
                    'tab' => 'rainlab.blog::lang.post.tab_edit',
                    'type' => 'richeditor',
                    'size' => 'huge'
                ]
            ]);
        });
    }

Best solution would be to have possibility to overwrite YAML files in same way as config files or language files.

@vizo

This comment has been minimized.

Copy link

commented Nov 2, 2015

👍

@vojtasvoboda

This comment has been minimized.

Copy link
Contributor Author

commented Jan 6, 2016

@kubamarkiewicz

This comment has been minimized.

Copy link

commented Jun 10, 2016

The first solution (editing fields.yaml) works fine.

However in the new version of blog plugin (1.2.6) that now supports translations you will also have to comment out the following line (81) in Controllers/Post.php:
$widget->secondaryTabs['fields']['content']['type'] = 'RainLab\Blog\FormWidgets\MLBlogMarkdown';

@xseguib

This comment has been minimized.

Copy link

commented Nov 9, 2016

solution of @kubamarkiewicz worked for me, but if I comment that line translation is not showing I just changed that line
from
$widget->secondaryTabs['fields']['content']['type'] = 'RainLab\Blog\FormWidgets\MLBlogMarkdown';
to
$widget->secondaryTabs['fields']['content']['type'] = 'richeditor';

@daftspunk

This comment has been minimized.

Copy link
Member

commented Nov 10, 2016

There are plugins available that can help with this. ProBlog is pretty popular.

@daftspunk daftspunk closed this Nov 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.