Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • George 58 posts 165 karma points
    Jan 09, 2020 @ 10:01

    Lazy loading images inside umbraco editor (uCKeditor)

    We are using Umbraco 7.10.3

    We have replaced our default text editor with the package uCKeditor.

    We have many pages where the text in the text editor contains multiple big images of 700 or 1000 + pixels width.

    Is there a way to add lazy loading for images in the Umbraco text editor content (specifically uCKeditor)?

    All we need to do is to change:

    <img src="/images/image-source.jpg" />

    to something like the following: (we already have a js function that handles all images that have a data-src attribute)

    <img src="/images/onepixelimg.png" data-src="/images/image-source.jpg" />

    I looked for CKeditor extensions, but there are none that can do this. Is there a way to process the text that we use from the textEditor property of the Umbraco page before we render it as HTML in the view and do the lazy loading that way? How can one lazy load images inside the Umbraco text editor in general?

Please Sign in or register to post replies

Write your reply to: