首页 \ 问答 \ 将多个内容CSS文件添加到CKEditor(Adding multiple content CSS files to CKEditor)

将多个内容CSS文件添加到CKEditor(Adding multiple content CSS files to CKEditor)

如何在CKEditor中使用超过1个CSS文件作为内容CSS? 我已经在配置中添加了bootstrap css。

config.contentsCss = '/css/bootstrap.min.css';

我们的设计师创建了第二个CSS来定制一些东西,我也需要将该CSS文件添加到CKEditor。

我尝试了下面的变化,但到目前为止没有成功:

config.contentsCss = '/css/bootstrap.min.css', '/css/styles.css';
config.contentsCss = '/css/bootstrap.min.css, /css/styles.css';

我正在使用v 4.1.1


How can I use more than 1 css file as content CSS with CKEditor? I already added bootstrap css in the config.

config.contentsCss = '/css/bootstrap.min.css';

Our designer created a 2nd css to customize some stuff and I also need to add that css file to CKEditor.

I tried variations below, but no success so far:

config.contentsCss = '/css/bootstrap.min.css', '/css/styles.css';
config.contentsCss = '/css/bootstrap.min.css, /css/styles.css';

I am using v 4.1.1


原文:https://stackoverflow.com/questions/29433760
更新时间:2022-11-22 15:11

最满意答案

您可以使用MongoDB聚合框架

这是一个查询,它会以所需的形式为您提供日期。 不过,我相信会有一些更好的和有效的方式来处理这个问题,但这是我想出的。

db.collection.aggregate([
  {"$unwind":"$class"},
  {"$unwind":"$class.people"},
  {"$match": {
      "class.people.name":"Susan"
       }
  },
  {"$group":{
      "_id":"$class.people.name",
      "classes":{"$push":"$class.name"}
    }
  }
])

结果: -

{ "_id" : "Susan", "classes" : [ "class 1", "class 2" ] }

$unwind操作之前尝试$match ,以避免$unwind之前的管道中产生不必要的结果。

请参阅聚合管道优化以提高性能。


You can make use of MongoDB aggregation framework.

Here is a query which will give you the date in the desired form. However, I believe that there will be some better and efficient way to handle this but this is what I came up with.

db.collection.aggregate([
  {"$unwind":"$class"},
  {"$unwind":"$class.people"},
  {"$match": {
      "class.people.name":"Susan"
       }
  },
  {"$group":{
      "_id":"$class.people.name",
      "classes":{"$push":"$class.name"}
    }
  }
])

Result :-

{ "_id" : "Susan", "classes" : [ "class 1", "class 2" ] }

Try to $match before first $unwind operation to avoid the unnecessary results in the pipeline before $unwind.

Refer Aggregation Pipeline Optimization for improved performance.

相关问答

更多
  • 得到它了: db.post.find({'author.$id': 'foo'}) Got it: db.post.find({'author.$id': 'foo'})
  • 那必须是: db.users.find({"name": /.*m.*/}) 或类似: db.users.find({"name": /m/}) 你正在寻找包含“m”的东西(SQL的' % '运算符等价于Regexp的' .* '),而不是“m”锚定到字符串的开头。 That would have to be: db.users.find({"name": /.*m.*/}) or, similar: db.users.find({"name": /m/}) You're looking for s ...
  • 你正在运行的查询没有给出正确的结果? 你使用的是什么版本的MongoDB? 您的$not查询不是MongoDB 2.6中的有效查询: > db.amon.find({ "$not" : { "code" : /^AAA/, "name" : { "$in" : ["BB", "CC"] } } }) error: { "$err" : "Can't canonicalize query: BadValue unknown top level operator: $not", "code" : ...
  • 也许$currentId是错误的类型? 看看你想要做什么,我认为它应该是MongoId实例 Maybe $currentId is of wrong type? Looking at what you're trying to do I think it should be instance of MongoId
  • 默认情况下,MongoDB将返回整个文档。 如果您只需要文档的一部分,则可以使用投影 。 尝试这个: db.prueba1.find({}, {mercancia: 1}) 它应该返回: { { _id: id-of-doc-one, mercancia: { ... } }, { _id: id-of-doc-two, mercancia: { ... } }, { _id: id-of-doc-three, mercancia: { ... } } } 如果你想要一个特定文件的merca ...
  • 您可以使用MongoDB聚合框架 。 这是一个查询,它会以所需的形式为您提供日期。 不过,我相信会有一些更好的和有效的方式来处理这个问题,但这是我想出的。 db.collection.aggregate([ {"$unwind":"$class"}, {"$unwind":"$class.people"}, {"$match": { "class.people.name":"Susan" } }, {"$group":{ "_id":"$class. ...
  • 正如Mongo最LIKE是正则表达式: db.my_collection.find({nm: /amet/}) 但我不认为你可以做你要求的,除非你可以编写一个捕获查询的包含和不包含部分的正则表达式。 也就是说,就像LIKE ,Mongo的正则表达式查询不具备性能。 如果您需要全文搜索,您应该查看像Solr或内置全文索引的数据库。 MY SOLUTION array( 'nm' => array( '$all' => array(new MongoRegex('/amet/'), ...), ...
  • 这是一般的正则表达式问题,应该是可搜索的 /^test/ ^插入符号表示该行的开始。 在mongo中也建议从一开始就进行搜索以提高效率,这意味着避免收集扫描。 有关此形式的更多信息,请参阅文档中的$ regex 。 将此作为书签,以及您可能需要的任何其他更改的参考。 http://www.cheatography.com/davechild/cheat-sheets/regular-expressions/ This is a general regex question and should be se ...
  • 我相信这个问题就是这样的。 我认为'desc'不是有效值,你可以尝试用-1替换它: { created: -1 } (我刚刚在这里测试了'desc'并得到了"$err" : "Can't canonicalize query: BadValue bad sort specification" ) 也许你Mongodb得到了更新,它停止了工作? So, I found my problem, I just need to update all my node module package, mainly mo ...
  • 好吧,6年前在php工作,但我认为你的$和运算符应该接受一系列查询, 像array('$and' => array(array('build_version' => array('$gte'=> (int)$version[2])), array('sub_version' => (int)$version[1])) '和'接受数组,因为你正在为'或'opeartor做,在这里你传递查询而不是数组。 Well, worked in php 6 years back but I think your $and ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)