Try our conversational search powered by Generative AI!

Adding a class to the img tag


Is there a way to automatically add a class to an image tag whenever a user adds an image in Episerver? I saw some posts about adding a class dropdown to the advimage dialog in the TinyMCE but I need to automatically add the class behind the scenes. I also need to change the src attribute name to data-src. Is this possible?



Sep 22, 2017 23:08

you could do some black magic with XHtml property rendering. here is described solution with images and converting them into <picture> tag.

Sep 24, 2017 22:01

Thanks. I was actually able to tap into the PublishEventInitializer class and alter the value before publishing. 

Sep 29, 2017 0:33
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.