TinyMCE" EditMenuName"将Episerver升级到版本11.5后,css属性不起作用

时间:2018-05-02 09:40:31

标签: css tinymce episerver

Episerver 升级到版本11.5后,能够为下拉列表中的菜单项设置自定义名称的 TinyMCE 功能不再有效。

我猜这个名为EditMenuName的特殊自定义CSS属性不起作用。那些菜单项只显示特定的CSS类名。不是作为" EditMenuName"提供的名称。属性。

如何让此功能再次运行?

1 个答案:

答案 0 :(得分:3)

对此没有任何支持。您可以做的是将这些项目添加到style_formats,请参阅https://www.tinymce.com/docs/configure/content-formatting/#style_formats。有关如何自定义编辑器https://world.episerver.com/documentation/developer-guides/CMS/add-ons/customizing-the-tinymce-editor-v2/的更多信息。

以下是配置示例:

config
.Default()
.Schema(TinyMceSchema.Html5Strict)
.ContentCss("/gui/css/base.css")
.AddPlugin("link table paste code contextmenu")
.Toolbar(
    "styleselect undo redo pastetext removeformat searchreplace code fullscreen",
    "bold italic numlist bullist outdent indent table epi-link unlink image epi-image-editor epi-personalized-content")
.StyleFormats(
    new { title = "Paragraph", format = "p" },
    new { title = "Header 2", format = "h2" },
    new { title = "Header 3", format = "h3" },
    new { title = "Header 4", format = "h4" },
    new
    {
        title = "Inline",
        icon = "forecolor",
        items = new[]
        {
            new { title = "Strikethrough", format = "strikethrough", icon = "strikethrough" },
            new { title = "Superscript", format = "superscript", icon = "superscript" },
            new { title = "Subscript", format = "subscript", icon = "subscript" },
            new { title = "code", format = "code", icon = "code" }
        }
    },
    new
    {
        title = "Blocks",
        icon = "template",
        items = new[]
        {
            new { title = "Blockquote", format = "blockquote" },
            new { title = "Preformatted", format = "pre" },
        }
    },
    new
    {
        title = "Images",
        icon = "image",
        items = new[]
        {
            new { title = "Left", selector = "img", classes = "left", icon = "alignleft" },
            new { title = "Right", selector = "img", classes = "right", icon = "alignright" },
            new { title = "Full-width", selector = "img", classes = "fullwidth", icon = "alignjustify" }
        }
    },
    new
    {
        title = "Tables",
        icon = "table",
        items = new[]
        {
            new { title = "Left", selector = "table", classes = "left", icon = "alignleft" },
            new { title = "Right", selector = "table", classes = "right", icon = "alignright" },
            new { title = "Full-width", selector = "table", classes = "fullwidth", icon = "alignjustify" }
        }
    });