Jump to content
DrQuincy

Prevent image resizing in PW CKEditor image dialog

Recommended Posts

I can see in the Page Edit Image config there is an option to stop Skip width attributes on image tags but although it doesn't set width="" on inserted images it does still allow the size to be set in the dialog. Also, if you resize it it creates a new image on the server:

pw-generated-image.thumb.png.ac8fb85ecc3d34b05467b571b9b994e2.png

I basically don't want any image resizing doing and no variations created. So what I want ideally is these options hiding:

pw-image-buttons.thumb.jpg.fd63747f710ec38d95dadd54bb7c49cb.jpg

I just want it as simple as possible and prefer to handle sizing outside of the editor (the Images field already uses client-size resizing).

Is this possible?

Share this post


Link to post
Share on other sites

@Zeka Interesting, thanks! I think if I can hide the parts I obscured in red that would do it. Is it easy to add custom CSS to the back-end?

Share this post


Link to post
Share on other sites
1 hour ago, DrQuincy said:

Is it easy to add custom CSS to the back-end?

Yes.

Share this post


Link to post
Share on other sites

For anyone that is interested in doing the same this seems to have worked. Place this in admin.php, before the controller.php line:

$config->styles->add('/assets/css/custom.css');

And then add this in your new custom.css file:

form#selected_image_settings p#wrap_info span#action_icons span { display: none; }

form#selected_image_settings p#wrap_info span#action_icons span#description_action { display: block; }

span#selected_image_pixels,
span#selected_image_checkboxes { display: none; }


Now you just get the image description button.

Make sure you check the Skip width attributes on image tags in the Page Edit Image config or set width and height to auto in your main site CSS.

I will test it out a bit more but seems to be working fine for now.

 

  • Like 3

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...