Closed (fixed)
Project:
Lazy-load
Version:
8.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 Jun 2019 at 20:53 UTC
Updated:
24 Sep 2020 at 00:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
le72Didn't find that important functionality too :-(
Comment #3
bessonweb commentedI update this issue because I think it is not a bug but a missing feature that will be very interesting.
Please some developer can build something?
Thanks!
Comment #4
bessonweb commentedComment #5
natalier commentedThere is no bug, you can choose in Views on Image Formatter->Blazy, it will add the class.
New update gave you more options
Comment #6
osmannatalier the formatter you mention of actually belongs to another module (Blazy).
Lazy-load only supports the content/view-mode style in Views. Field mode of Views is not supported yet.
However I agree, I think it would be great to support Views fields style. Patches are welcome.
Comment #7
osmanComment #8
bessonweb commentedJust for help, in my case I have changed the views image field formatter to "Image URL" and used "Rewrite results" in my image field and make this :
<img src="<YOUR PLACEHOLDER IMG URL>" data-src="{{ field_image }}" width="350" height="200" alt="{{ field_image__alt }}" typeof="foaf:Image" class="img-responsive b-lazy">It work good and it is the proper solution for the moment I think.
Hope that help!
Comment #9
hn0852 commentedA way to solve this issue is by making a new field formatter for the view that extend media_thumbnail.
You can learn more here https://www.drupal.org/docs/8/creating-custom-modules/creating-custom-fi.... The key here, is to define
$element['lazy_image']in thefunction settingsForm.Comment #11
osmanViews with fields now can benefit from lazy-loading via added 2 new formatters: Image (Lazy-load), and Responsive image (Lazy-load).
These formatters can also be enabled to use with field display settings in entity display settings:
Comment #12
osmanComment #13
osmanComment #15
mrupsidownI have a View of Media images and I can't seem to be able to enable lazy loading. I don't see the formatters in the view field configuration. I have enabled both formatters in the settings. Am I missing something?