3 Provides integration with bLazy to lazy load and multi-serve images to save
4 bandwidth and server requests. The user will have faster load times and save
5 data usage if they don't browse the whole page.
10 o Supports core Responsive image.
11 o Supports Colorbox/Photobox, also multimedia lightboxes.
12 o Supports Retina display.
13 o Multi-serving images for configurable XS, SM and MD breakpoints, almost
14 similar to core Responsive image, only less complex.
15 o CSS background lazyloading, see Mason, GridStack, and Slick carousel.
16 o IFRAME urls via via custom coded, Blazy Image with Media entity via Video
17 Embed Media, or see Slick Video, Slick Media.
18 o Delay loading for below-fold images until 100px (configurable) before they are
20 o A simple effortless CSS loading indicator.
21 o It doesn't take over all images, so it can be enabled as needed via Blazy
22 formatter, or its supporting modules.
26 o Views fields for File ER and Media Entity integration.
27 o Views style plugin Blazy Grid.
28 o Field formatters: Blazy, and Blazy Image with Media integration.
33 o Download bLazy from https://github.com/dinbror/blazy
34 o Extract it as is, rename "blazy-master" to "blazy", so the assets are at:
36 /libraries/blazy/blazy.min.js
40 Install the module as usual, more info can be found on:
41 http://drupal.org/documentation/install/modules-themes/modules-7
45 Be sure to enable Blazy UI which can be uninstalled at production later.
46 o Go to Manage display page, e.g.:
47 admin/structure/types/manage/page/display
49 o Find "Blazy" formatter under "Manage display".
51 o Go to "admin/config/media/blazy" to manage few global options, including
52 enabling support for lazyloading core Responsive image.
54 For custom usages, add a class "b-lazy" along with a "data-src" attribute
55 referring to an expected image or iframe URL, or to any supported element:
56 IMG, IFRAME or DIV/BODY, etc.
57 Non-media element, DIV/BODY/etc., will have background image lazyloaded instead.
59 Wrap the parent container with [data-blazy attribute containing the expected
60 options to limit the scope, or for simple need without aspect ratio. Add extra
61 class .blazy to support aspect ratio with multi-serving images.
62 And load the blazy library accordingly.
65 MODULES THAT INTEGRATE WITH OR REQUIRE BLAZY
70 o Slick (D8 only by now)
71 o Slick Views (D8 only by now)
76 Most duplication efforts from the above modules will be merged into
77 \Drupal\blazy\Dejavu namespace.
81 https://www.drupal.org/project/lazyload
82 https://www.drupal.org/project/lazyloader
86 Resizing is not supported. Just reload the page.
89 Blazy provides two simple Views fields for File ER, and Media Entity.
91 When using Blazy formatter within Views, check "Use field template" under
92 "Style settings", if trouble with Blazy Formatter as stand alone Views output.
93 On the contrary, uncheck "Use field template", when Blazy formatter
94 is embedded inside another module such as GridStack so to pass the renderable
96 This is a Views common gotcha with field formatter, so be aware of it.
97 This confusion should be solved later when Blazy formatter is aware of Views.
100 If the images appear to be shrinked within a floating container, add
101 some expected width or min-width to the parent container via CSS accordingly.
102 Non-floating image parent containers aren't affected.
105 Add a min-height CSS to individual element to avoid layout reflow if not using
106 Aspect ratio or when Aspect ratio is not supported such as with Responsive
107 image. Otherwise some collapsed images containers will defeat the purpose of
108 lazyloading. When using CSS background, the container may also be collapsed.
109 Both layout reflow and lazyloading delay issues are actually taken care of
110 if Aspect ratio is enabled in the first place.
112 Adjust, and override blazy CSS files accordingly.
116 [x] Adds a basic configuration to load the library, probably an image formatter.
118 [x] Media entity image/video, and Video embed field lazyloading, if any.
120 Added both simple Blazy Media formatter and Views field Media Entity.
121 o Makes a solid lazyloading solution for IMG, DIV, IFRAME tags.
124 CURRENT DEVELOPMENT STATUS
125 A full release should be reasonable after proper feedbacks from the community,
126 some code cleanup, and optimization where needed. Patches are very much welcome.
128 Alpha and Beta releases are for developers only. Be aware of possible breakage.
132 Visit any of the following URLs when updating Blazy, or its related modules.
134 1. /admin/config/development/performance
135 Unless an update is required, clearing cache should fix most issues.
137 o Hit "Clear all caches" button once the new Blazy in place.
138 o Regenerate CSS and JS as the latest fixes may contain changes to the assets.
140 2. /admin/reports/status
141 Check for any pending update, and run /update.php from the brower address bar.
143 3. If Twig templates are customized, compare against the latest.
147 o If breakpoints provided with tons of images, using image styles with ANY crop
148 is recommended to avoid image dimension calculation with individual images.
149 The image dimensions will be set once, and inherited by all images as long as
150 they contain word crop. If using scaled image styles, regular calculation
154 AUTHOR/MAINTAINER/CREDITS
158 https://www.drupal.org/node/2663268/committers
162 See the project page on drupal.org: http://drupal.org/project/blazy.
164 See the bLazy docs at:
165 o https://github.com/dinbror/blazy
166 o http://dinbror.dk/blazy/