Implement lazyload from Drupal core

Created on 22 August 2023, over 1 year ago
Updated 13 September 2023, over 1 year ago

Problem/Motivation

Drupal core 9.1.0+ supports the lazyload html attribute for images: https://www.drupal.org/node/3173719
Drimage does not currently implement this by default, but you can select it.
It instead uses a custom Javascript implementation for lazyloading.

Proposed resolution

1/ Make the html lazyload option work by default.
2/ Add a lazyload option for our legacy JS, so existing projects don't change.
3/ Make the html lazyload from drupal core the default option for drimage
4/ Mark our custom JS solution as deprecated.

User interface changes

1/
Add an extra option under "Image loading":
"Legacy (custom JS)": "Uses the legacy custom Javascript option built in drimage to detect when images come in to view."

2/
Clearly mark the "Lazyloader offset" option in the settings as deprecated and guide users toward using the drupal core html lazyload.

API changes

None

Data model changes

lazyload legacy option will be added as a setting in the drimage formatters.

Feature request
Status

Fixed

Version

2.2

Component

Code

Created by

🇧🇪Belgium weseze

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024