Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Lazy Views

Security covered Under active development 176 sites

Part of the Lazy ecosystem · 5 projects

This module allows you to load Drupal Views on demand, either when a user clicks a button or link, or automatically when the page loads. It supports AJAX Views, respecting permissions, filters, and sorting.

A very simple module to load views either by click of a button/anchor or on page load.

Features

  • Load any Ajax view anywhere on the page via trigger or on page load
  • Respects Views permissions
  • Supports Filters
  • Supports Sorting

Installation

Consult https://www.drupal.org/docs/8/extending-drupal-8/installing-contributed-...
to see how to install and manage modules in Drupal 8.

Usage

First make sure the view you are wanting to load has "Use Ajax" set to Yes, without that this will not work.

You can load views either via a triggering element or just on page load using data attributes. The minimum requirement is to include the view id, view display.

Example: Trigger

The following would load the "Recent Content" view block into the div upon click of the anchor.

<a data-lv-id="content_recent" data-lv-display="block_1" href="#">Click Me</a></p>
<div class="lazy-view">&nbsp;</div>

Example: On load

The following loads the view into itself upon page load.

<div id="lazy-view" data-lv-id="content_recent" data-lv-display="block_1" data-lv-execute="true" data-lv-target="lazy-view"></div>

Example: Fully Decorated

The following demonstrates all data attributes available. Note that the target attribute can accept either a class or an id.

<button data-lv-id="content_recent" data-lv-display="block_1" data-lv-args='1,5' data-lv-target='my-custom-area' data-lv-execute='true'>Click Me</button>

<div id="my-custom-area">Loading Content...</div>
Drupal 10–11

Ask your assistant about Lazy Views

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Apr 2024
Latest release
6 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core PHP Release date
1.0.2 Stable 10–11 May 15, 2026
1.0.1 Stable 10–11 Apr 15, 2024