bluecadet / bluecadet_ajax_content
Library to handle AJAXing content utilizing Drupal's AJAX.
Package info
github.com/bluecadet/bluecadet_ajax_content
Type:custom-drupal-module
pkg:composer/bluecadet/bluecadet_ajax_content
Requires
- php: ^7.4||^8.0
- bluecadet/bc_drupal_package_manager: ^1.0
- composer/installers: ^1.9||^2.0
- drupal/core: ^10
- oomphinc/composer-installers-extender: ^2.0
This package is auto-updated.
Last update: 2026-08-05 15:02:19 UTC
README
A Drupal module that provides a library for handling AJAX content loading utilizing Drupal's AJAX system.
Requirements
- Drupal 10.5+ or Drupal 11.2+
- PHP 8.2 or higher
Versions
1.x Branch
- 1.1.x: Drupal 10.5+/11.2+ support (PHP 8.2+)
- 1.0.x: Drupal 10.x support (PHP 7.4+)
Includes
Submodules
- bluecadet_ajax_content_example
Not using Composer
If you are not using composer, you can delete all unneeded files.
- composer.json
Using Composer
If you are using composer to manage Drupal modules, make sure you add custom location for this module to be downloaded to. You must add the installer types line as well as the location for the module.
... "installer-types": ["custom-drupal-module"], "installer-paths": { "web/core": ["type:drupal-core"], "web/modules/contrib/{$name}": ["type:drupal-module"], "web/modules/custom/{$name}": ["type:custom-drupal-module"], "web/profiles/contrib/{$name}": ["type:drupal-profile"], "web/themes/contrib/{$name}": ["type:drupal-theme"], "drush/contrib/{$name}": ["type:drupal-drush"] }, ...
Testing
This module includes automated tests that run via GitHub Actions against:
- Drupal 10.5.x and 10.6.x (PHP 8.2 and 8.3)
- Drupal 11.2.x and 11.3.x (PHP 8.3)
- MariaDB 10.6 and 11.4
Test Plan
Automated Tests (GitHub Actions)
The CI pipeline runs the following for each Drupal version:
- PHPCS - Drupal coding standards validation
- DrupalPractice - Best practices validation
- Drupal-Check - Deprecation and compatibility checking
- PHPUnit Functional JavaScript Tests - Tests AJAX content loading
Manual Testing Checklist
For comprehensive validation, manually test the following:
-
Simple/Immediate AJAX Load (
/ajax-content/simple-example)- Verify content replaces placeholder on page load
- Confirm no JavaScript errors in console
-
Scroll-triggered AJAX Load (
/ajax-content/scroll-example)- Verify content loads when scrolling into view
- Test IntersectionObserver functionality
-
AJAX Commands Load (
/ajax-content/ajax-commands-example)- Verify Drupal AJAX commands execute correctly
- Confirm CSS/JS attachments load
-
Custom Event Triggers
- Test
data-ajax-triggerattribute functionality - Verify custom events dispatch correctly
- Test
Changelog
1.1.x
- Added Drupal 11 compatibility
- Updated minimum PHP version to 8.2
- Updated PHPUnit configuration for PHPUnit 10+
- Updated GitHub Actions workflow for modern Drupal versions
- Fixed test namespace and annotations
1.0.x
- Initial commit allowing for 3 different types of Content AJAXing
- Adding in another "trigger" type for Content AJAXing