【问题标题】:CKEditor not showing with easyadmin integrationCKEditor 未与 easyadmin 集成显示
【发布时间】:2020-02-17 12:33:24
【问题描述】:

我创建了一个新的 Symfony4 项目并安装了 EasyAdmin 包(工作正常)。 我尝试按照文档集成 CKeditor:https://symfony.com/doc/master/bundles/EasyAdminBundle/integration/ivoryckeditorbundle.html

这是我的 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'] } ] } }} 

这里是我的 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'] }

问题仍然是显示的常规文本区域,而不是 ckeditor 富文本区域。

我试图清除缓存,在 twig.yaml 中添加“-'@FOSCKEditor/Form/ckeditor_widget.html.twig'”,但我仍然看不到 ckeditor 工具栏。 有人知道我缺少什么吗? 谢谢!

【问题讨论】:

    标签: ckeditor symfony4 easyadmin


    【解决方案1】:
    git 上的

    vkhramtsov 刚刚建议我将“@FOSCKEditor/Form/ckeditor_widget.html.twig”表单主题添加到“config/packages/”中的“easyadmin:design:form_theme:list” easy_admin.yaml”像这样:

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

    这解决了我的问题。我认为文档需要更新。他们建议放置表单模板的位置目前(twig:form_themes)不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-15
      • 1970-01-01
      • 2015-12-22
      • 1970-01-01
      • 1970-01-01
      • 2019-07-27
      相关资源
      最近更新 更多