<p>Found this plugin doing some digging <a href="https://github.com/mmikkel/Retcon-Craft" rel="nofollow noreferrer">https://github.com/mmikkel/Retcon-Craft</a>. 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.</p>

CC BY-SA 4.0
2020-02-18T14:15:40.390Z
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
CC BY-SA 4.0
2020-02-15T00:19:07.217Z
2020-02-15T00:19:07.217Z
Kelly B
<p>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. </p>

<p>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.</p>

<redactor>
Can I Configure Redactor to Automatically Add a Class to Img Tags?
# Can I Configure Redactor to Automatically Add a Class to Img Tags?

(Asked by: username_0 on 2020-02-14)

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.

**Tags:** redactor

---

## 1 answers

### Answer by username_1 on 2020-02-15. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: 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.  

---

