Jump to content

prevent image cropping in ckeditor


manuel1981
 Share

Recommended Posts

11 hours ago, manuel1981 said:

I want to disable the crop and align features when placing an image into the CKEditor.

I suggest just hiding the controls with some custom CSS in the admin (you can add this with Admin On Steroids or Admin Custom Files). That way it's easier to update the core without losing your customisations.

47 minutes ago, manuel1981 said:

Any idea how to preset the width for the images?

One approach is to intercept and modify images in CKEditor fields using a textformatter. Take a look at Image Interceptor.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, manuel1981 said:

The  Image Interceptor works like a charm! Unfortunately only in 2.7.

I just tested it and it seems to work fine in PW 3.x. What kind of problem are you seeing?

Or do you just mean the modules directory doesn't specifically say it is compatible with 3.x? All that means is that the module author hasn't recently updated the directory info. If in doubt about compatibility for any PW module my suggestion is just install it and give it a try - most older modules work fine in 3.x. And something like a Textformatter module isn't that sensitive to updates in the core.

Link to comment
Share on other sites

@manuel1981 not sure if this would solve your problem, but i have a 3.x site that uses this module, and i do know that I changed line 389

https://github.com/Da-Fecto/TextformatterImageInterceptor/blob/master/TextformatterImageInterceptor.module#L389

from

$class['align'] . " "

to this:

isset($class['align']) ? $class['align'] . " " : '',

i'm not sure if that would be the cause of an error, but i was getting tracy log errors with this module before i changed it. Also, speaking of Tracy, you should have that installed so you can detect what if any errors this module may be generating in your setup...

  • 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...