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
Closed

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

vojtasvoboda opened this issue Aug 11, 2015 · 9 comments

Comments

@vojtasvoboda
Copy link
Contributor

@vojtasvoboda vojtasvoboda 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
Copy link
Contributor

@gergo85 gergo85 commented Aug 18, 2015

You should try to the Wysiwyg Editors plugin.

Loading

@vojtasvoboda
Copy link
Contributor Author

@vojtasvoboda vojtasvoboda 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

Loading

@robertsamurai
Copy link

@robertsamurai robertsamurai 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.

Loading

@vojtasvoboda
Copy link
Contributor Author

@vojtasvoboda vojtasvoboda 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.

Loading

@vizo
Copy link

@vizo vizo commented Nov 2, 2015

👍

Loading

@vojtasvoboda
Copy link
Contributor Author

@vojtasvoboda vojtasvoboda commented Jan 6, 2016

Loading

@kubamarkiewicz
Copy link

@kubamarkiewicz kubamarkiewicz 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';

Loading

@xseguib
Copy link

@xseguib xseguib 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';

Loading

@daftspunk
Copy link
Member

@daftspunk daftspunk commented Nov 10, 2016

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

Loading

@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
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants