TinyMCE没有在工具栏中显示“hr”

时间:2014-12-04 15:18:40

标签: javascript jquery html5 tinymce text-editor

我正在尝试使用TinyMCE作为编辑器,并希望能够添加“hr”元素。我已经添加了插件,但我没有在编辑器中看到“hr”按钮/选项。

对此问题的任何见解都会很棒!

以下是我启动它的方式:

tinymce.init({
    selector: "textarea",
    plugins: [
        "template advlist autolink link image lists charmap print preview",
        "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
        "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
        "save table contextmenu directionality emoticons template paste textcolor"
    ],
    browser_spellcheck : true ,
    toolbar: "undo redo | styleselect | bold italic | link image | template ",
    menubar: false,
    resize: "both",
    content_css: "/Content/bootstrap.min.css, /Content/Site.css",
    template_cdate_classes: "cdate creationdate",
    template_mdate_classes: "mdate modifieddate",
    template_selected_content_classes: "selcontent",
    template_cdate_format: "%m/%d/%Y : %H:%M:%S",
    template_mdate_format: "%m/%d/%Y : %H:%M:%S",
    file_browser_callback_types: 'file image media',

    templates: [
        {
            title: "Center Column",
            url: "/Scripts/tinymce/template/center_column.html",
            description: "Adds Editor Name and Staff ID"
        },
        {
            title: "Two Column w/ Image Right",
            url: "/Scripts/tinymce/template/two_column_image_right.html",
            description: "Adds an editing timestamp."
        },
        {
            title: "Two Column w Image Left",
            url: "/Scripts/tinymce/template/two_column_image_left.html",
            description: "Adds an editing timestamp."
        },
        {
            title: "Contact Page",
            url: "/Scripts/tinymce/template/contact_page.html",
            description: "Adds an editing timestamp."
        }
    ]


});

2 个答案:

答案 0 :(得分:2)

您的工具栏语法应如下所示:

toolbar: "hr undo redo | styleselect | bold italic | link image | template ",

我在按钮堆栈的开头插入了hr按钮,但您可以将其插入任何需要的位置。希望tinyMCE会在relevant page上写下这个。

答案 1 :(得分:0)

您没有将HorizontalRule添加到toolbar选项。