In Drupal 7 - we added config.startup Mode = 'source'; to the JS field to startup a CKeditor in Source mode - - how do I accomplish that in Drupal 8?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ThoreauinSF’s picture

Any response to this query please?

wells’s picture

It looks like hook_editor_js_settings_alter is what you need to check out for changing CKEditor's config options. This is a global CKEditor config so I am hesitant to include an option for it in this module.

  • wells committed 6a4a77d on 8.x-1.x
    Issue #2946714: Add ability to set source view as default and reorganize...
wells’s picture

Component: Miscellaneous » Code
Assigned: Unassigned » wells
Category: Bug report » Feature request
Status: Active » Needs review

On second thought, I like this idea and have added in to 8.x-1.x-dev. Please give it a try and let me know if it works.

  • wells committed 45c9cb8 on 8.x-1.x
    Issue #2946714: Update schema for config object changes.
    
wells’s picture

Status: Needs review » Fixed
ThoreauinSF’s picture

@wells - thanks for adding this - however - when I turn it on - it renders all my text fields invisible.

is there a cache clear that I missed somewhere that will make these present?

wells’s picture

@rmcdiarmid - Sorry about that! I marked this fixed and was going to publish a 2.0 release with the dev branch but haven't had the time to get it done.

There are some breaking changes on the dev branch as we removed the Libraries API dependency. The easiest way to update is likely to just redownload the CKEditor CodeMirror library and place it in the root /libraries folder of your Drupal installation. Here are the notes from the updated README (note particularly that the basis is now the full library from GH, not just the "codemirror" sub-folder):

INSTALLATION
------------
1. Download and install CKEditor CodeMirror module.
2. Download and uncompress the latest CKEditor-CodeMirror-Plugin release and
   rename the folder to "ckeditor_codemirror" such that the resulting path to
   the "plugin.js" file should be:
   "libraries/ckeditor_codemirror/codemirror/plugin.js".
ThoreauinSF’s picture

ty - I figured that out as well :) So awesome - thank you for doing this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.