【问题标题】:How do I customise the WYSIWYG (TinyMCE) field for Admin UI in KeystoneJS 5 -- adding plugins, changing CSS?如何在 KeystoneJS 5 中为管理 UI 自定义 WYSIWYG (TinyMCE) 字段——添加插件、更改 CSS?
【发布时间】:2020-06-17 21:35:40
【问题描述】:

KeystoneJS 提供了所见即所得字段类型的选项

此字段根据文本将字符串路径插入到您的架构中 字段类型实现,并在 Admin 中呈现 WYSIWYG 编辑器 使用 TinyMCE 的用户界面

如何编辑基于 TinyMCE 的所见即所得编辑器插件和外观?在 KeystoneJS 文档中的 this page 上,它说我们可以传入一个对象,我假设它被命名为 editorConfig

编辑器配置

默认值:{}

接受任何 TinyMCE 配置选项。这些将被传递给 tinymce.init 可用于覆盖 Keystone.js 的默认编辑器 外观和功能。

但它不适合我。

const editorConfig = {
 selector: 'textarea',
 menu: {
  format: { title: "Format", items: "forecolor backcolor" }
 },
 toolbar: "forecolor backcolor"
};


text: { type: Wysiwyg, editorConfig},

当我尝试加载 CSS 时

const editorConfig = {
    selector: 'textarea',
    content_css: '/tinymce.css',

};

永远不会加载 CSS。

我尝试使用config 代替editorConfig,但这也不起作用。

【问题讨论】:

    标签: tinymce keystonejs


    【解决方案1】:

    虽然它在文档中,但尚未在向公众发布的版本中。应该是几天后,他们说:https://github.com/keystonejs/keystone/issues/2486#issuecomment-595178710

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-18
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      • 2018-05-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多