删除静态块上的自动P标记

时间:2014-04-07 02:23:59

标签: magento tinymce

如何删除静态块或静态页面上的自动<p> tag,我应编辑哪个js文件?

我也不想禁用所见即所得编辑器

已经检查过js / mage / adminhtml / wysiwyg / tiny_mce / setup.js 仍然不知道它在哪里

var settings = {
            mode : (mode != undefined ? mode : 'none'),
            elements : this.id,
            theme : 'advanced',
            plugins : plugins,
            theme_advanced_buttons1 : magentoPlugins + 'magentowidget,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect',
            theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor',
            theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,ltr,rtl,|,fullscreen',
            theme_advanced_buttons4 : 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak',
            theme_advanced_toolbar_location : 'top',
            theme_advanced_toolbar_align : 'left',
            theme_advanced_statusbar_location : 'bottom',
            theme_advanced_resizing : true,
            convert_urls : false,
            relative_urls : false,
            content_css: this.config.content_css,
            custom_popup_css: this.config.popup_css,
            magentowidget_url: this.config.widget_window_url,
            magentoPluginsOptions: magentoPluginsOptions,

感谢

3 个答案:

答案 0 :(得分:5)

wysiwyg编辑器需要forced_root_block才能使用段落样式。 这个forced_root_block默认设置为“p”。

答案 1 :(得分:2)

进入系统&gt;配置

从左侧菜单中选择内容管理

点击右侧的 WYSIWYG选项

Set Enable WYSIWYG Editor value to Disabled by Default

完成

答案 2 :(得分:0)

编辑js / mage / adminhtml / wysiwyg / tiny_mce / setup.js

var settings = {
        mode : (mode != undefined ? mode : 'none'),
        elements : this.id,
        theme : 'advanced',
        plugins : plugins,
        theme_advanced_buttons1 : magentoPlugins + 'magentowidget,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect',
        theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor',
        theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,ltr,rtl,|,fullscreen',
        theme_advanced_buttons4 : 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak',
        theme_advanced_toolbar_location : 'top',
        theme_advanced_toolbar_align : 'left',
        theme_advanced_statusbar_location : 'bottom',
        theme_advanced_resizing : true,
        convert_urls : false,
        relative_urls : false,




        forced_root_block : '', /* <-- Add this setting */




        content_css: this.config.content_css,
        custom_popup_css: this.config.popup_css,
        magentowidget_url: this.config.widget_window_url,
        magentoPluginsOptions: magentoPluginsOptions,

来源:https://stackoverflow.com/a/26396255/1136132