0

I will now quote from CKeditor project page at Drupal.org:

To use CKEditor in Drupal, you may need to download CKEditor (the library which this module relies on). This would not be necessary starting from version 7.x-1.14 (not released yet - 24 April, 2014), where the installation has been simplified and CKEditor from official CDN is available by default.

As you could see in the picture, my sites/all/modules/ckeditor/ckeditor folder is empty, i.e the folder where you put the library... So my question is, given that the library's folder is empty by default, is it even possible to update the JS library but not the module...? Is it even possible after version 7.x-1.14? Or should I wait to the coming Drupal module release? Thanks.

enter image description here

3 Answers 3

2

Yes.

Libraries should not be store in module directories for the reason that it makes it harder to update things.

Best practice is to install the Libraries API module and put the library in sites/all/libraries (or an equivalent libraries directory if you're using an install profile or something).

CKEditor and a lot of other modules integrate with the libraries API module.

The CDN option that is referred to in your quoted text is different though. In that case you don't need to have the CKEditor plugin anywhere in your website files. Instead the module will use a copy of the library from the CDN.

It's possible there could be performance implications from not using a local version but I haven't actually tested that.

3
  • After the desired library (desired by means of version) has been placed in sites/all/libraries, will it automatically be recognized by the Drupal CKeditor module? or maybe there is any action needed for it?
    – user16289
    Apr 29, 2015 at 23:38
  • 1
    It should be automatically recognised. CKEditor module will check sites/all/libraries by default and if you have the libraries api module installed it will use it to check all libraries directories (in the case of multi-site, install profiles, etc.).
    – rooby
    Apr 29, 2015 at 23:42
  • I also added a part to my answer about the CDN option.
    – rooby
    Apr 29, 2015 at 23:42
0

Yes, you can drop in the CKEditor JS libraries at any time. It shouldn't interfere since there are file exist checks made in the code. Many modules that require 3rd party libraries do this.

As for the post 7.1.14 upgrade, you should be fine add the libraries before then. It shouldn't interfere with the upgrade; after the upgrade it will be loading the libraries from a different, public CDN URL instead of your local site URL.

1
  • Hey Shawn, My own installed version is 7.1.16... It's the most updated Drupal version. If I understand you correctly I should just add the desired library in sites/all/modules/ckeditor/ckeditor, clear cache and that's basically it?
    – user16289
    Apr 29, 2015 at 23:32
0

As @rooby said, you should be using the Libraries API module and then simply downloading the latest version of CKEditor and untar'ing it into /sites/all/libraries so that you end up with /sites/all/libraries/ckeditor/.

AKA Download this, and put it in your /sites/all/libraries folder. You should end up with /sites/all/libraries/ckeditor/ If not just shuffle around the directories until it's correct.

What's next? Download the WYSIWYG module and deploy it. When you go to configure it, assuming you deployed the CKEditor correctly into your libraries then this module should automagically detect that you have CKEditor installed and you can select it as the default editor for the various filter types (Filtered, Full etc).

Today, you should not be using the CKEditor module directly and should be using the WYSIWYG module instead. It allows you to deploy various different WYSIWYG editors of your choice for various different filter types at your choosing.

4
  • Using the WYSIWYG module is a valid option but I disagree that "you should not be using the CKEditor module directly". It is personal preference and it is perfectly valid to use the CKEditor module. After using both WYSIWYG and CKEditor modules a lot over the course of many years I personally now always use the CKEditor module instead of the WYSIWYG module.
    – rooby
    Apr 30, 2015 at 1:31
  • @rooby Fair enough. I'll agree that CKEditor is pretty much the defacto goto wysiwyg editor of choice for pretty much everyone. Although I disagree with the sentiment of it being a matter of preference (although I guess it is). IMO best practice would be to use the WYSIWYG module which let's you be free of any module dependency and simply rely on recognized libraries that you have deployed. Why would you argue any differently? Even if your pref. is CKEditor why not just use it with the WYSIWYG module? Maybe the poor sod that takes over from you years later does not like CKEditor.
    – skålfyfan
    Apr 30, 2015 at 1:40
  • Because I think the way the CKEditor module is administered is better and the CKEditor drupal module supports more of CKEditors plugins. CKEditor module also gives more control over the UI that the user sees when editing. I think CKEditor module is maintained more actively and the developer is able to give more time to CKEditor because they don't have to worry about supporting other editors. I have found support for custom CKEditor styles to be buggy in some cases with the add-on CKEditor Styles (for WYSIWYG) module. I'm sure I also have more reasons I cannot remember right now.
    – rooby
    Apr 30, 2015 at 2:10
  • In general I also think that some compromises have to be made when making any generic pluggable module instead of directly integrating with one more specifically. I think that the likelyhood that someone will want to change editor on one of the sites I have built is so low that it doesn't outweigh the benefits I perceive of me using CKEditor currently. If it was more likely that a site I was building would need to change editors I would definitely consider using WYSIWYG module but that usually isn't the case for me. Also, it wouldn't be very hard to switch from the CKEditor module later anyway
    – rooby
    Apr 30, 2015 at 2:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.