【发布时间】:2017-07-28 14:00:42
【问题描述】:
目前我们仅限于这些 样式、粗体、斜体、链接、取消链接、锚点、表格、BulletedList、块引用、罢工、下标、上标
有什么办法可以在这里添加更多的东西,例如:color 和 abc 这样我们就可以根据我们在css中的要求改变abc属性了
谢谢
【问题讨论】:
标签: apostrophe-cms
目前我们仅限于这些 样式、粗体、斜体、链接、取消链接、锚点、表格、BulletedList、块引用、罢工、下标、上标
有什么办法可以在这里添加更多的东西,例如:color 和 abc 这样我们就可以根据我们在css中的要求改变abc属性了
谢谢
【问题讨论】:
标签: apostrophe-cms
是的,你可以这样做。请参阅官方 HOWTO:configuring CKEditor in Apostrophe. 这还包括如何配置 Apostrophe 的 HTML 清理过滤器以允许您想要的东西。
【讨论】:
allowedTags:['h3','h4','h5','h6','blockquote','p','a','ul','ol','span', 'nl'、'li'、'b'、'i'、'strong'、'em'、'strike'、'code'、'hr'、'br'、'div'、 'table','thead','caption','tbody','tr','th','td','pre','bgcolor', 'sup', 'sub' ],
['Bold','span','h6','Italic','-','Subscript','Superscript','-','Link'],*
所以在 allowedTag 中 span 是可用的,但是当我在工具栏中放同样的东西时,我只看到 Bold , Italic 但看不到 span
【讨论】:
我尝试添加 justify 插件,以便能够将文本右对齐、左对齐或居中对齐。但是在按照文档中的说明进行操作之后,我想知道插件是否应该位于特定文件夹中(我的文件夹位于 public/modules/apostrophe-areas/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');
};
}
});
【讨论】: