Advertising sustains the DA. Ads are hidden for members. Join today

Contributed module documentation

Lazy-load

Lazy-load gives the user ability to enable lazy-loading the images on their Drupal 7 and 8 sites. This guide focuses only on Drupal 8 features. See Lazy-load for Drupal 7 guide.

This module offers to enable lazy-loading on image fields, and also for inline-images used in CKeditor fields. You can even enable your theme images to use lazy-loading with some easy markup change.

How to use Composer to install Lazy-load module and its dependency

Lazy-load module integrates lazysizes javascript library, and requires it to be installed to libraries directory.

How to enable lazy-loading for inline-images and iframes?

Configure text-format to use Lazy-load.

What's new on 8.x-3.x

All the bug fixes, and new features added since 8.x-2.0

Screenshots

Lazy-load screenshots from various pages.

Tips & Tricks

How to customize Lazy-load in your module or theme

lazy_is_enabled() is deprecated

lazy_is_enabled() is deprecated in lazy:8.3.x and is removed from lazy:8.3.1.

lazy_disabled_by_path() is deprecated

lazy_disabled_by_path() is deprecated in lazy:8.3.x is removed from lazy:8.3.1.

lazy_field_types() is deprecated

lazy_field_types() is deprecated in lazy:8.3.x and is removed from lazy:8.3.1. Instead, you should use lazy_field_formatters().