您现在的位置是:首页 > cms教程 > 帝国CMS教程帝国CMS教程
帝国7.5默认编辑器增加代码高亮的方法
凡梅2023-05-20帝国CMS教程已有人查阅
导读需要下载的插件及依赖工具,将下载的插件解压,并复制到帝国的ckeditor目录下,注意是后台的那个默认后台目录:eadminecmseditorinfoeditorplugins

https://ckeditor.com/cke4/addon/
需要下载的插件及依赖工具
1、Code Snippet
2、widget
3、lineutils
4、widgetselection
安装步骤
将下载的插件解压,并复制到帝国的ckeditor目录下,注意是后台的那个
默认后台目录:eadminecmseditorinfoeditorplugins
修改配置文件
配置文件路径:eadminecmseditorinfoeditORConfig.js
配置文件中共有两个工具条,一个是全功能的,一个是精简的
在两个工具条中添加代码工具CodeSnippet
然后在工具条下方添加代码工具的配置
这里我把我的发上来供大家参考
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.filebrowserImageUploadUrl = '';
config.filebrowserFlashUploadUrl = arraycs[0];
config.filebrowserImageBrowseUrl = arraycs[1];
config.filebrowserFlashBrowseUrl = arraycs[1];
config.enterMode = CKEDITOR.ENTER_BR;
config.shiftEnterMode = CKEDITOR.ENTER_P;
config.allowedContent= true;
config.font_names='宋体/宋体;黑体/黑体;仿宋/仿宋_GB2312;楷体/楷体_GB2312;隶书/隶书;幼圆/幼圆;微软雅黑/微软雅黑;'+ config.font_names;
// Toolbar
config.toolbar_full = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source', '-', 'Preview', 'Print' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 'ecleanalltext', 'autoformat' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'etranmore', 'Flash', 'etranmedia', 'etranfile', '-', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet', 'equotetext', 'einserttime', 'einsertpage', 'einsertbr' ] },
'/',
{ name: 'styles', items: [ 'Styles', 'Format', 'Font', 'FontSize' ] },
{ name: 'colors', items: [ 'TextColor', 'BGColor' ] },
{ name: 'tools', items: [ 'ShowBlocks', 'NewPage', 'Templates' ] },
{ name: 'others', items: [ '-' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', 'Maximize' ] }
];
// Toolbar
config.toolbar_basic = [
{ name: 'document', groups: [ 'mode', 'document', 'doctools' ], items: [ 'Source' ] },
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },
{ name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] },
{ name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar','CodeSnippet' ] },
{ name: 'tools', items: [ 'Maximize' ] },
{ name: 'others', items: [ '-' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Strike', '-', 'RemoveFormat' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ], items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },
{ name: 'styles', items: [ 'Styles', 'Format' ] },
];
config.extraPlugins = 'etranfile,etranmedia,etranmore,autoformat,ecleanalltext,einsertbr,einsertpage,einserttime,equotetext';
config.extraPlugins ='codesnippet';
config.codeSnippet_theme = 'monokai_sublime';
config.toolbar = 'full';
};
本文标签:
很赞哦! ()
相关教程
图文教程
帝国CMS7.5版修改后台登录地址的方法
帝国CMS7.5版在原来版本支持自定义后台目录基础上(可随时任意重命名admin目录,无需任何设置),还新增了支持自定义后台登录文件,双重自定义,安全性更高。
帝国CMS二次开发怎么引用函数文件的方法
like是广泛的模糊匹配,字符串中没有分隔符,Find_IN_SET 是精确匹配,字段值以英文”,”分隔,Find_IN_SET查询的结果要小于like查询的结果。
帝国CMS内容模板怎么验证权限的写法
在文章系统模型中添加了两个字段,member:普通会员可以查看的内容;vip:VIP会员可以查看的内容。游客:打开网页后,看到[newstext]字段里的内容
帝国CMS8.0升级功能汇总
一、新增支持postgreSQL数据库和国产数据库:(支持国产数据库如:国产华为高斯(openGauss)、国产金仓数据库(kingbase)等)1、为了适配其它数据库,所有数据表查询限制数量单独函数返回,并保存在各数据库操作类文件里。
相关源码
-
(自适应)宽屏农业机械农耕设备类网站pbootcms模板免费下载为农机企业打造的现代化响应式网站模板,自动适配电脑、平板和手机,浏览体验一致,独立页面SEO设置,提升搜索引擎可见度。查看源码 -
(带手机版)绿色生态农业种植农产品网站pbootcms源码下载本模板基于PbootCMS内核开发,为生态农业企业量身打造,适用于农业种植、有机农场、农产品电商等业务场景。模板设计充分体现绿色环保理念,突出农业特色,同时保持简洁大气的视觉效果,帮助农业企业建立专业形象。查看源码 -
(PC+WAP)楼承板建筑工程合金钢铁材料pbootcms网站源码下载为楼承板生产商及建筑工程企业设计的响应式网站模板,采用PbootCMS内核开发,同步适配电脑与移动设备浏览。通过模块化结构展示工程案例、产品参数等专业内容,帮助建筑建材企业建立标准化数字展示平台,提升行业专业形象。查看源码 -
(PC+WAP)绿色产品环保设备垃圾桶厂家公司网站pbootcms模板为垃圾桶生产商、环保设备企业打造的高端响应式门户模板,基于PbootCMS开源内核深度开发。采用HTML5自适应架构,无缝实现PC与手机端数据实时同步与交互优化查看源码 -
(自适应)游泳馆泳池水处理器设备pbootcms网站模板免费下载专注服务于泳池水处理设备制造商、泳池系统工程商等企业用户。模板预设设备分类体系、技术参数展示模块和解决方案呈现页面,满足行业特有展示需求。查看源码 -
帝国CMS7.5养生生活健康网模板完整带会员中心可封装APP本套模板为生活服务类网站设计,适用于两性健康、减肥瘦身、生活资讯等领域。采用帝国CMS7.5核心开发,结构清晰合理,视觉体验舒适,能够有效满足相关行业的建站需求。查看源码
| 分享笔记 (共有 篇笔记) |

