Lazy Load Field

Component ID

2245769

Component name

Lazy Load Field

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Note: Ajax Include Pattern 1.4+ requires jQuery 1.7+. The easiest way to do this is jquery_update but this is not a dependency as users may wish to update jQuery in other ways. Alternatively, download and use v1.3 of the library.

Lazy Load Field allows any field to be loaded with AJAX rather than included in the initial page download. This is useful for fields that would otherwise add significantly to the page download so that the initial page load is quicker (particularly on mobile devices). Additionally, a media query can be specified (per field) so that the field is only loaded under certain conditions.

The module uses (and requires) the Ajax-Include-Pattern Javascript library by The Filament Group to replace this empty span with the fully rendered field. The field will use all of its normal settings and configuration for display.

Installation

  1. Download the module and extract to your preferred module location (e.g. sites/all/modules).
  2. Download the library and extract to your preferred libraries location (e.g. sites/all/libraries) and rename the directory to 'ajax_include_pattern'.
  3. Enable the module.
  4. Go to 'Manage Display' for the content type and view mode you wish to enable.
  5. Edit the settings for the field you wish to enable lazy loading for, tick the checkbox and optionally add a media query to control the loading.