emilianotisato / nova-tinymce

Laravel Nova TinyMCE editor (with images upload capabilities!)
MIT License
116 stars 39 forks source link

Can't get LFM to work #10

Closed gizburdt closed 5 years ago

gizburdt commented 5 years ago

Hi,

Awesome package!

I can't get the image upload with LFM to work (I don't see an image upload icon in the TinyMCE toolbars). This is in my Nova Resource:

NovaTinyMCE::make('Content')
                ->options([
                    'use_lfm' => true,
                ])

The LFM package is installed via composer.

Am I missing something?

emilianotisato commented 5 years ago

@gizburdt Yes, you are not adding the 'plugins' and the 'toolbar' keys in the options array. This is needed because otherwise javascript (the TinyMCE script) doe't no kwon witch tools to render in the toolbar.

Did you see the example in the readme for this repo??

gizburdt commented 5 years ago

Ah ok!

Which values do I need to set in plugins/toolbar to enable the image upload with lfm?

Thanks! :)

emilianotisato commented 5 years ago

Start with this:

NovaTinyMCE::make('body')->options([
                'plugins' => [
                    'advlist autolink lists link image charmap print preview hr anchor pagebreak',
                    'searchreplace wordcount visualblocks visualchars code fullscreen',
                    'insertdatetime media nonbreaking save table contextmenu directionality',
                    'emoticons template paste textcolor colorpicker textpattern'
                ],
                'toolbar' => 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media',
                'use_lfm' => true
                ]),

And then remove the plugins and toolbar options you don't need

gizburdt commented 5 years ago

Ok thanks! :)

michapixel commented 4 years ago

i had to fiddel the lfm_url too and set a route:

Route::group(['prefix' => 'laravel-filemanager', 'middleware' => ['web', 'auth']], function () {
    \UniSharp\LaravelFilemanager\Lfm::routes();
});