Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom alignment classes in Page Edit Image not working in CKEditor #800

Open
schwaaab opened this issue Jan 27, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@schwaaab
Copy link

commented Jan 27, 2019

Short description of the issue

The Alignment Classes in Modules->Configure->ProcessPageEditImageSelect cannot change to anything but the default classes. CKEditor does not recognize other set custom classes.

Expected behavior

The custom classes should be recognized by CKEditor and put to the img element.

Actual behavior

None other than the default classes work. You can add another class like "align_left uk-align-left", but only align_left gets recognized.

Steps to reproduce the issue

  1. Go to Modules->Configure->ProcessPageEditImageSelect and change the custom alignment classes
  2. go to a page textarea field with ckeditor active and put in text and an image
  3. use the alignment on the image to float it to the text

Setup/Environment

  • ProcessWire version: 3.0.120
  • PHP version: 7.2.8
  • 10.1.34-MariaDB
@Toutouwai

This comment has been minimized.

Copy link

commented Feb 1, 2019

I took a quick look and I think the change needed to support multiple align classes is something like the following at line 642:

$validClasses = array_merge(explode(' ', $this->alignLeftClass), explode(' ', $this->alignCenterClass), explode(' ', $this->alignRightClass));

Also, currently the user has to manually allow any custom align classes as "Extra Allowed Content" for CKEditor fields. But given that ProcessPageEditImageSelect invites the user to enter custom align classes it would be better if these were automatically allowed for CKEditor rather than the current scenario where the allowed align classes are hardcoded in the pwimage plugin: https://github.com/processwire/processwire/blob/6ad523966655a03c60f3d76a9b38f7f3dfd2d33e/wire/modules/Inputfield/InputfieldCKEditor/plugins/pwimage/plugin.js#L13-L17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.