TinyMCE 工具栏选择不出现在自定义工具栏中

发布于 2025-01-20 21:21:45 字数 1179 浏览 1 评论 0原文

我正在将新的Tinymce实例安装到Textarea中。我正在使用他们的CDN加载它,并注册了API代码,并在仪表板上重新登录了我的网站。它可以正常工作并加载Tinymce,直到我尝试修改工具栏以添加选择选项。

更明确的是,当我没有配置加载时,我会看到各种标题,块等的“段落”下拉列表等。但是,当我尝试加载示例或自定义自己的示例时,我看不到这些选项。

使用此配置:

tinymce.init({
    selector: '#content',
    plugins: 'fullscreen, link, image, table, code, lists, emoticons, advlist, charmap, searchreplace, codesample ',
        
    toolbar: [
      'undo redo | forecolor backcolor | formatting | align |  numlist bullist | blockquote | link | image | table | code | template | symbol | searchreplace ',
      'undo redo | sizeselect | styleselect | formatselect | fontselect | fontsizeselect | fullscreen '
    ],
    toolbar_groups: {
      formatting: {
        icon: 'bold',
        tooltip: 'Formatting',
        items: 'bold italic underline | superscript subscript | codesample'
      },
      align: {
        icon: 'align-left',
        tooltip: 'Alignment',
        items: 'alignleft aligncenter alignright alignjustify'
      },
      symbol: {
        icon: 'insert-character',
        tooltip: 'Symbol',
        items: 'emoticons | charmap'
      }
    }
});

在第二个工具栏上,我只看到撤消,重做和全屏的图标。没有选择渲染。

I am installing a new TinyMCE instance into a textarea. I am loading it using their cdn, and have registered an API Code, and registed my website on the dashboard. It works and loads tinyMCE correctly until I try to modify the toolbars to add the select options.

To be more clear, when I load with no configuration, I see a "Paragraph" Dropdown with the various Headings, Blocks etc. However when I try to load examples, or customize my own, I do not see those options.

Using this configuration:

tinymce.init({
    selector: '#content',
    plugins: 'fullscreen, link, image, table, code, lists, emoticons, advlist, charmap, searchreplace, codesample ',
        
    toolbar: [
      'undo redo | forecolor backcolor | formatting | align |  numlist bullist | blockquote | link | image | table | code | template | symbol | searchreplace ',
      'undo redo | sizeselect | styleselect | formatselect | fontselect | fontsizeselect | fullscreen '
    ],
    toolbar_groups: {
      formatting: {
        icon: 'bold',
        tooltip: 'Formatting',
        items: 'bold italic underline | superscript subscript | codesample'
      },
      align: {
        icon: 'align-left',
        tooltip: 'Alignment',
        items: 'alignleft aligncenter alignright alignjustify'
      },
      symbol: {
        icon: 'insert-character',
        tooltip: 'Symbol',
        items: 'emoticons | charmap'
      }
    }
});

On the second toolbar, I only see icons for undo, redo and fullscreen. None of the selects render.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦回旧景 2025-01-27 21:21:45

如果您使用 TinyMCE 5,配置应该可以正常工作。但是,如果您使用 TinyMCE 6,则工具栏按钮已重命名:https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/#things-we-renamed。因此,在这种情况下,您需要使用类似以下内容: 'undo redo |尺码选择 |款式 |块|字体家族 |字体大小 |全屏”

The configuration should work fine if you're using TinyMCE 5. However, if you're using TinyMCE 6 then the toolbar buttons were renamed: https://www.tiny.cloud/docs/tinymce/6/migration-from-5x/#things-we-renamed. So in that case, you'd need to use something like this instead: 'undo redo | sizeselect | styles | blocks | fontfamily | fontsize | fullscreen'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文