London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

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.