Jump to content

CKEditor won't allow classes {"left", "right"}


hellomoto
 Share

Recommended Posts

I have CKEditor set as the input type for my summary textarea field, and in its settings, Use ACF is enabled, and in Extra Allowed Content I have "*(left,right)". Yet when I add either of those classes to a ul or p element in the field, they're still stripped on save. Can anyone tell me why or point me in the direction of solving this..? Thanks much.

Link to comment
Share on other sites

Hello.

You can try to switch off ACF ("No") and check what you get.

But also here is another working solution (in two 2 steps):

1. in site/modules/InputfieldCKEditor create newstyles.js with content:

CKEDITOR.stylesSet.add( 'newstyles', [
 { name: 'Left aligned', element: ['address', 'p', 'ul'], attributes: { 'class': 'left' } },
 { name: 'Right aligned', element: ['address', 'p', 'ul'], attributes: { 'class': 'right' } },
 { name: 'Read more button', element: ['a'], attributes: { 'class': 'button' } }
]);

2. inside field settings need to set this:

- Use ACF: No

- Custom Editor js Styles Set: newstyles:/site/modules/InputfieldCKEditor/newstyles.js

NOTE: After this, you will see dropdown list of additional classes only when you inside editor select tag from the list (address, p, ul, a).

Regards.

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...