Create a new admin extending and overriding the default one. https://github.com/PiedWeb/CMS/blob/master/src/Admin/PageAdmin.php
$formMapper->add('mainContent', CKEditorType::class
Change the service with your new page admin class :
piedweb.admin.page:
class: App\Admin\PageAdmin
arguments: [~, '%app.entity_page%', ~]
tags:
- { name: sonata.admin, manager_type: orm, label: admin.label.page }
calls:
- [ setFeedDumper, [ '@piedweb.feed.dumper' ] ]
- [ setLiipImage, [ '@liip_imagine.cache.manager' ] ]
- [ setTemplate, [list, '@@PiedWebCMS/admin/media_mosaic.html.twig']]
- [ setTemplate, [outer_list_rows_mosaic, '@@PiedWebCMS/admin/media_mosaic_body.html.twig']]
public: true
Install fos cke bundle https://github.com/FriendsOfSymfony/FOSCKEditorBundle
composer require friendsofsymfony/ckeditor-bundle
Update your configuration for ckeditor
twig:
form_themes:
- '@FOSCKEditor/Form/ckeditor_widget.html.twig'
fos_ck_editor:
configs:
my_config_1:
toolbar: "my_toolbar_1"
toolbars:
configs:
my_toolbar_1: [ ["Format", "Bold", "Italic", "RemoveFormat", "-", "BulletedList", "Blockquote", "-", "@basic.links", "-", "Source", "-", "Maximize" , "Save" ] ]