CMS企业模板|CMS模板|CMS网站定制|CMS模板下载

站内搜索 售前咨询 售后服务 建站帮助 微博 博客 在线客服
  • 网站模板
  • 定制开发
  • 案例展示
  • 最新动态
  • 关于我们
  • 联系我们
  • 问答社区

CMSYOU互助问答社区

诚信合作, 高质专业!
CMSYOU互助问答社区
使用新浪微博账号登录 登录 注册
  • 搜索
  • 问题
  • 话题
  • 用户
发起

CKEDITOR编辑器怎么自定义工具,做到简化?

Phpcms V9 CKEDITOR 编辑器
Phpcms v9用的是CKEDITOR编辑器,是否可以自定义或者简化?
2017-10-15 10:05 0 条评论 分享

站外

邮件

要评论问题请先登录或注册

1 个回复

CMSYOU - CMS企业网站定制专家

赞同来自:

CKEditor中的工具栏默认显示所有功能按钮,CKEditor工具栏自定义配置非常简单。

注意工具按钮是分组的,一个name内的大括号就是一个工具按钮分组,items后边是具体的按钮,“/”表示工具栏换行,“-”表示工具图标之间的中隔线“|”
(特别说明:config.js中没有下面的代码,默认就是显示全部按钮,但如果对工具栏进行自定义,最好的办法还是把下面的代码全部复制到config.js,然后再删除一个个不需要的按钮)

config.toolbar = 'Full';

config.toolbar_Full =
[
    { name: 'document', items : [ 'Source','-','Save','NewPage','DocProps','Preview','Print','-','Templates' ] },
    { name: 'clipboard', items : [ 'Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo' ] },
    { name: 'editing', items : [ 'Find','Replace','-','SelectAll','-','SpellChecker', 'Scayt' ] },
    { name: 'forms', items : [ 'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 
        'HiddenField' ] },
    '/',
    { name: 'basicstyles', items : [ 'Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat' ] },
    { name: 'paragraph', items : [ 'NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv',
    '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','-','BidiLtr','BidiRtl' ] },
    { name: 'links', items : [ 'Link','Unlink','Anchor' ] },
    { name: 'insert', items : [ 'Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe' ] },
    '/',
    { name: 'styles', items : [ 'Styles','Format','Font','FontSize' ] },
    { name: 'colors', items : [ 'TextColor','BGColor' ] },
    { name: 'tools', items : [ 'Maximize', 'ShowBlocks','-','About' ] }
];

config.toolbar_Basic =
[
    ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']
];


下面给出两个优化后的CKEDITOR工具条代码:
1、中等实用CKEditor简化示范:
config.toolbar = 'Full';
    config.toolbar_Full = [
        {name: 'document',items: ['Source', '-', 'DocProps', 'Preview', 'Print', '-']},
        {name: 'clipboard',items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
        {name: 'editing',items: ['Find', 'Replace', '-', 'SelectAll', '-']},
        { name: 'basicstyles',items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
        '/',
        {name: 'paragraph',items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl']},
        {name: 'links',items: ['Link', 'Unlink', 'Anchor']},
        {name: 'insert',items: ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak']},
        '/',
        { name: 'styles',items: ['Styles', 'Format', 'Font', 'FontSize']},
        { name: 'colors',items: ['TextColor', 'BGColor']},
        { name: 'tools',items: [ 'ShowBlocks', '-']}
    ];
    config.toolbar_Basic = [['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink', '-', 'About']];

2、最简化的实用CKEditor示范:
CKEDITOR.replace( 'content',{height:200,pages:true,subtitle:true,textareaid:'content',
toolbar :
[
['Bold', 'Italic', 'Underline', 'TextColor', 'BGColor', '-', 'NumberedList', 'BulletedList', 'Outdent', 'Indent', 'Blockquote', '-', 'Image', 'Table', 'Link', 'Unlink' ],['Maximize'],
]
});
2017-10-15 10:07 0 条评论

分享

要参与问题请先登录或注册

0

为什么被折叠?0 个回复被折叠

要回复问题请先登录或注册

相关问题

Phpcms V9怎么判断模型ID,做到不同不同模型显示不同样式? 美橙的香港主机支持自定义404页面吗? 怎么简化Phpcms V9专题的生成路径,解决路径太深? Phpcms V9表单向导的邮件内容怎么增加上自定义的字段? phpcms搜索列表页,怎么采取自定义的分页样式? Phpcms v9前台用户投稿页面编辑器不能上传图片? 百度编辑器怎么样自动保存本地word图片? CMSYOU大虾们,检查网站死链用什么工具比较好? phpcms换成百度编辑器后原来内容里边的图片不见了,怎么办?

问题状态

最新活动:2017-10-15 10:07

浏览:2465 次

关注:1 人

Copyright © 2008-2025 CMSYOU - 互助问答社区 - 粤ICP备10060801号-3   rss feed RSS Feed
欢迎加入QQ群(346494585)Phpcms V9企业模版交流 CMS定制咨询
“让我们一起来学习CMS建站吧!”