This module allows you to configure blocks to load using Ajax. Instead of rendering the block directly, a placeholder is shown, and the block's content is loaded and displayed via Ajax. This can be useful for bypassing caching mechanisms, though it may not be necessary if you are using Drupal's BigPipe module.
Provides the ability to load blocks via Ajax method. One can easily configure new and existing blocks to load via Ajax.
Essentially a placeholder will be dropped in place instead of fully rendering the block. The block content will be pulled from a custom route and then rendered in place via Ajax.
Rendering or display blocks via Ajax is sometimes necessary to get around various levels of caching on a site.
On the other hand, please note that in many cases you won't need this, if you use BigPipe Core Module.
Requirements
No special requirements. Essentially requires Drupal Core blocks.
Install
Install like any other contributed module. Installing through composer is recommended:
Composer
composer require drupal/block_ajax
drush en block_ajax
Usage
- Visit Structure -> Block layout page.
- Edit or create new block.
- New section should appear on block called "Ajax Block".
- Check "Load block via Ajax".
- Configure any other necessary block settings. Save block.
- Place block in region.
- Test page where block was placed, and it should load via Ajax.
Supporting this module
Support DROWL's ♥ FOSS work on this module on OpenCollective!
Drupal and this module are FOSS. However, it takes dedicated people to develop and maintain. And they need YOU to give back!
We're committed to building and maintaining Drupal modules that benefit the entire community.
Supporting us on OpenCollective helps us continue to improve, innovate and contribute to Drupal's future. Every pledge makes a difference!
If this module has helped you, we would be very grateful for your donation to support its further development and maintenance.
Support our FOSS development ♥️
You can also speed up the development of features or bugfixes you'd love to see, by sponsoring and giving back!
Let's make Drupal even better, together!
Ask your assistant about Block AJAX
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
- Token
- block Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.