6

I'm actually working on a project who needs a WYSIWYG interface with Symfony 4.4 and EasyAdmin 3.

I've tried to install FOS_CKEditor by following this doc https://symfony.com/doc/2.x/bundles/EasyAdminBundle/integration/ivoryckeditorbundle.html and some others tutorials that i've found on Google or Youtube, but unfortunatly I can't figure out why the CKEditorField does not display on my admin dashboard. I think i've been missing something.

Some help would be appreciate, here's my configs files :

Fos_ckeditor:

#config/packages/fos_ckeditor.yaml

twig:
    form_themes:
        - '@FOSCKEditor/Form/ckeditor_widget.html.twig'

fos_ck_editor:
    configs:
        basic_conf:
            toolbar: full

EasyAdmin :

#config/packages/easy_admin.yaml

easy_admin:
    design:
        form_theme:
            - "@EasyAdmin/form/bootstrap_4.html.twig"
            - "@FOSCKEditor/Form/ckeditor_widget.html.twig"

I've also tried to define the FieldType in the CrudController by adding this :

#CrudController

 public function configureFields(string $pageName): iterable
{
    return [
        ..//
        TextareaField::new('corps', 'Corps')
        ->setFormType(CKEditorType::class),

But it didn't worked.

Thanks by advance for your help !

mubadara
  • 61
  • 1
  • 2
  • Hello, same issue for me. I'm using EasyAdmin 3 with Symfony 5.1. There is no documentation right now to create a WYSIWYG on EasyAdmin 3 – Alexis Aug 03 '20 at 15:03
  • Hi, I'm still looking for a way to make this work, if I find it I'll let you know For now I'm using the "TextEditorField" provide by TrixEditor, but it's a bit poor in terms of functionality – mubadara Aug 04 '20 at 17:45

3 Answers3

8

According to https://github.com/EasyCorp/EasyAdminBundle/issues/3412 you can add

public function configureCrud(Crud $crud): Crud
{
    return $crud
        ->addFormTheme('@FOSCKEditor/Form/ckeditor_widget.html.twig')
    ;
}

It worked fine for me :)

Bouffe
  • 770
  • 13
  • 37
0

Try updating the fos_ck_editor part like this :

fos_ck_editor:
    input_sync: true
    default_config: base_config
    configs:
        base_config:
            toolbar: full
Claire S
  • 1
  • 1
  • Still not working I had an other answer telling me that CKEditor wasnt working with EasyAdmin 3, so I don't know if i'm not wasting my time & yours Thanks for your help, anyway – mubadara Aug 02 '20 at 04:15
0

For anyone still having trouble with this, after adding the line from Bouffe's comment make sure you have the assets installed with commands:

bin/console ckeditor:install
bin/console assets:install public

This worked for me on EasyAdminBundle 3 and Symfony 5 with FOSCKEditorBundle 2.

z3r0
  • 1
  • 1