1

I am trying to set up lazy loading for the images on my site but currently, any image added via Redactor lacks the necessary 'lazyload' class.

Is there any way to configure Redactor to automatically add this class to any image added through Redactor? I have been digging through the documentation on their site and doing some googling but so far haven't found anything.

2

Found this plugin doing some digging https://github.com/mmikkel/Retcon-Craft. It looks like it can achieve what you need - appending existing attributes (including class names) by applying a filter to your Redactor field in your Twig template.

| improve this answer | |
  • Thanks, Kelly. I was hoping there was a config option for Redactor so I wouldn't have to rely on another plugin but I don't think I am going to find that so I will definitely look into this. – muddygrey Feb 18 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.