javascript

Add Multi-Element Wrapper Class With CKEditor in Drupal 8

The task at hand here is to allow the client to create a classed wrapper around multiple elements using CKEditor in Drupal 8.

The fundamental problem here is the CKEditor's built in "Styles" dropdown classes each <p> individually, while we need a class wrapping them.

You could probably make or install your own CKEditor plugin, but that's not what I did.

I did this with Javascript.

Subscribe to javascript