Try our conversational search powered by Generative AI!

Adding a class to the img tag

Vote:
 

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?

Thanks,

Scott

#182566
Sep 22, 2017 23:08
Vote:
 

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

#182570
Sep 24, 2017 22:01
Vote:
 

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

#182776
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.