2
votes

I created a new Symfony4 project and installed EasyAdmin bundle (which works fine). I tried to integrate CKeditor following the documentation : https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/ivoryckeditorbundle.html

Here is my easyadmin.yaml:

 easy_admin:
    entities:
       TestPage:
            class: App\Entity\TestPage
            form:
                fields:
                    - { property: 'content', type: 'fos_ckeditor', type_options: { 'config': { 'toolbar': [ { name: 'styles', items: ['Bold', 'Italic', 'BulletedList', 'Link'] } ] } }} 

here my fos_ckeditor.yaml :

twig:
    form_themes:
        - '@FOSCKEditor/Form/ckeditor_widget.html.twig'
fos_ck_editor:
    input_sync: true
    default_config: base_config
    configs:
        base_config:
            toolbar:
                - { name: "styles", items: ['Bold', 'Italic', 'BulletedList', 'Link'] }

The problem is it's still the regular textarea that is showing, not the ckeditor rich text one.

I tried to clear the cache, to add "- '@FOSCKEditor/Form/ckeditor_widget.html.twig'" in twig.yaml but i still can't see the ckeditor toolbar. Anyone has an idea on what i'm missing ? Thanks!

1

1 Answers

6
votes

vkhramtsov on git has just advised me to add the "@FOSCKEditor/Form/ckeditor_widget.html.twig" form theme to "easyadmin:design: form_theme:list" in "config/packages/easy_admin.yaml" like this:

easy_admin:
design:
    form_theme: # Both themes are needed for ckeditor integration
        - "@EasyAdmin/form/bootstrap_4.html.twig"
        - "@FOSCKEditor/Form/ckeditor_widget.html.twig"

This solved the problem for me. I think the docs need to be updated. The place they suggest to put the form template presently (twig:form_themes) does not work.