如何在工具栏中添加更多内容

时间:2017-05-25 22:23:09

标签: apostrophe-cms

目前我们仅限于这些 样式,粗体,斜体,链接,取消链接,锚点,表,项目符号列表,Blockquote,罢工,下标,上标

有没有办法在这里添加更多东西,例如:color和abc 这样我们就可以根据css中的要求改变abc属性

谢谢

3 个答案:

答案 0 :(得分:0)

是的,你可以这样做。请参阅官方HOWTO:configuring CKEditor in Apostrophe.这还包括如何配置Apostrophe的HTML清理过滤器以允许您想要的东西。

答案 1 :(得分:0)

allowedTags:[' h3',' h4',' h5',' h6',' blockquote' ,''''' ul'' ol'' span',             ' nl',' li',' b','我',' strong',' em& #39;,'罢工','代码'' hr',' br',' div',             ' table',' thead',' caption',' tbody',' tr',' th& #39;,' td',' pre',' bgcolor',             ' sup',' sub' ],

['粗体''跨度'' H6''斜体'' - &#39 ;, '下标'上标',' - ','链接'],*

所以在allowedTag中可以使用span,但是当我在工具栏中放入相同的东西时,我只看到Bold,Italic但不是span

答案 2 :(得分:-1)

我尝试添加对齐插件,以便能够将文本右对齐,左对齐或居中对齐。但是在按照文档中的说明后,我想知道插件是否应该位于特定的文件夹中(我的是在public / modules /撇号-sarth / js / ckeditorPlugins / justify /)也是如何在工具栏中调用插件的

这是我的代码,以防万一:(位于lib / modules / apostrophe-areas / public / js / user.js)

apos.define('apostrophe-areas', {
  construct: function(self, options) {
    // Use the super pattern - don't forget to call the original method
    var superEnableCkeditor = self.enableCkeditor;
    self.enableCkeditor = function() {
      superEnableCkeditor();
      // Now do as we please
      CKEDITOR.plugins.addExternal('justify', '/modules/apostrophe-areas/js/ckeditorPlugins/justify/', 'plugin.js');
    };
  }
});