Skip to content

Choose which blocks are to be loaded by-passing the page cache and refreshed after loading.

License

Notifications You must be signed in to change notification settings

backdrop-contrib/ajaxblocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ajax Blocks

This module gives site administrator the ability to choose which blocks are to be loaded dynamically.

The module is suitable for sites which are mostly static, and the page caching for anonymous users is a great benefit, but there are some pieces of information that have to be dynamic.

The classical example is Ubercart sites which has to show the cart content in a block.

The other example is showing random pictures or links to nodes (from some view output which randomizes data).

The fallback is loading the block regularly with the page load, returning the cached block content if the page is cached.

This process can require less resources than generating the whole page, and the page loading time can be significantly decreased comparing to the case of disabling this page caching. Search engine bots (and even DoS attacks) will produce less load to the server. So, blocks with dynamic content (cart, random banners, list of logged in users, etc.) can be viewed on the cached pages.

This module uses the awesome, easy-to-use htmx library.

Installation

  1. Install this module as usual.
  2. For every block that has to be loaded by AJAX request, go to this block configuration page and turn on 'Load block via AJAX' option in 'AJAX settings' fieldset.
  3. Visit the site as anonymous user and check that new request is performed after loading the page.
  4. If you want to reduce page flickering, you can set (in css) the appropriate width and height of block content placeholders.

Issues

Bugs and Feature requests should be reported in the Issue Queue.

Current Maintainers

Credits

License

This project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.

About

Choose which blocks are to be loaded by-passing the page cache and refreshed after loading.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages