You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#116862 Default Border Radius for Images

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by ibweb on Wednesday, 11 September 2024 01:33 BST

ibweb

Is there any way to set images to have a default border-radius when inserting the image within an article via JCE Editor's image manager?

Our theme uses rounded edges for images, and it'd be great if we could make it easier for our team when adding images if it would have a matched border radius style for an images added via JCE.

Ryan

The best way to do this is with a css class, which you can set as a default value in the Classes field in the Image Manager Extended parameters, in Editor Profiles -> Plugin Parameters -> Image Manager Extended

Check if your template already has an appropriate class to use, which it might already if it using Bootstrap - https://getbootstrap.com/docs/4.6/utilities/borders/#border-radius

So in this case, you could add rounded-sm to the Classes field for a subtle border raduis on images.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ibweb

Thanks for that resource. Yes, there is already a class we could apply easily. We tested this and it worked for any images that are inserted on a go-forward basis. It looks like it wouldn't apply to old images which makes sense.

It looks like this can be added to both Image Manager and Image Manager Extended which is perfect.  

Ryan

It looks like it wouldn't apply to old images which makes sense.

It would be possible to do this with some css in your template stylesheet, but could be difficult to target them accurately, for example in a Joomla 5 article you could use:

.com-content-article img:not(.rounded-sm) {
    border-radius: .2rem !important;
}

 

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

ibweb

Thanks for that alternate option. Since the site we were asking about is actually in development, we are all set with the original class addition you recommended.

However, the second idea you gave regarding retroactively addressing the issue on images already inserted is helpful for future knowledge.

I believe we are all set, so I'll proceed with closing out this ticket. Thanks so much for your speedy responses and help!