EasyAdminBundle: FOS CkEditor integration doesn't convert textarea fields
I implemented the FOS CKEditor based on the guidelines found on the official symfony docs and designated a form field to show as ckeditor. I’ve also tried type: 'fos_ckeditor' with the same results.
Page:
class: CmsBundle\Entity\Page
list:
fields:
- 'title'
- 'slug'
- 'user'
- 'lastUpdate'
form:
fields:
- { property: 'title', type: 'text' }
- { property: 'content', type: 'FOS\CKEditorBundle\Form\Type\CKEditorType' }
I expected the textarea to change into a Ck Editor Type but the regular textarea keeps showing. It seems the ckeditor javascript and stylesheets are not getting loaded by symfony. I do see the form field has gotten a ‘field-ckeditor’ class so I assume the form type is at least doing something.
My environment consists of a Symfony 3.4 installation and I’m using webpack encore for the asset management. Also no errors/warnings in the log files.
To Reproduce Install a Symfony 3.4 environment, create an entity and initialize easy admin with a field set to fos_ckeditor. Easy Admin version 1.17
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (2 by maintainers)
@pal-ecl, @jjsmclaughlin Have you tried to add form themes to easyadmin design like here https://github.com/PHP-Belarus/php.of.by/blob/master/src/PhpOfBy/AdminBundle/Resources/config/easy_admin_config.yaml#L2 ? It works for me. Additional information you can find here https://github.com/EasyCorp/EasyAdminBundle/issues/2958
Adding
@FOSCKEditor/Form/ckeditor_widget.html.twig.totwig.form_themesas described in https://github.com/FriendsOfSymfony/FOSCKEditorBundle/issues/161#issue-387285347 resolves the issue for meI’ve just installed FOSCkEditor in a EasyAdmin app successfully. Basically you need to run these three commands:
This worked for me … but please tell me if the error persists. Thanks!
hi ! I confirm this problem! it breaks my local and production… it’s very disturbing as modifications ^^‘’ now you need add
design: form_theme: # Both themes are for ckeditor integration - "@EasyAdmin/form/bootstrap_4.html.twig" - "@FOSCKEditor/Form/ckeditor_widget.html.twig"enjoy another !
Symfony 5 & easy_admin I don’t undestand why ckeditor doesn’t convert textarea field type: ‘FOS\CKEditorBundle\Form\Type\CKEditorType’ type: ‘fos_ckeditor’ or type: ‘ckeditor’ why?
I have the same issue as LeanderFS. I’m trying to use FOSCKEditorBundle with easyadmin, following Symfony doc : https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/ivoryckeditorbundle.html But the regular textarea keeps showing instead of the CKeditor one. I tried to add ‘@FOSCKEditor/Form/ckeditor_widget.html.twig’ to twig.form_themes, and clear the cache, but nothing changed. I use symfony 4. Any tips ? Thanks