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: ^8.2
- bluecadet/bc_drupal_package_manager: ^1.1
- composer/installers: ^1.9||^2.0
- drupal/core: ^10.5 || ^11.2
- oomphinc/composer-installers-extender: ^2.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- 1.x-dev
- 1.1.0-rc.2
- 1.1.0-rc.1
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- dev-feature/deps-and-readme-update
- dev-feature/add-controller-tests
- dev-fix/ci-coverage-accuracy
- dev-feat/d11-ups-pt2
- dev-feat/general-updates-pr-11
- dev-copilot/update-bluecadet-bldr-dependency
- dev-copilot/refactor-drupal-controllers
- dev-copilot/upgrade-module-for-drupal-11
This package is auto-updated.
Last update: 2026-09-14 20:25:05 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: Example controllers demonstrating the three AJAX content loading patterns
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-10.6.x and 11.2.x-11.3.x (PHP 8.2-8.4, MariaDB 10.4/10.6) -- see .github/drupal-ci.yml for the exact matrix.
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
- PHPStan - Drupal-aware static analysis
- PHPUnit Functional JavaScript Tests - Tests AJAX content loading
Current coverage
No dedicated unit/kernel tests exist yet -- the only automated test is a Functional JavaScript test exercising the three AJAX loading patterns end to end. Both the parent module's .module file and bluecadet_ajax_content_example's controller classes are measured by the coverage report, but neither has real line coverage from that single functional test.
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
- Moved CI to a shared, config-driven orchestrator in
bluecadet/web-gh-actions - Moved
bluecadet_ajax_content_exampleundermodules/, matching the standard submodule layout the shared CI's test/coverage discovery expects - Fixed several postcss plugins that were silently relying on an old transitive dependency rather than being declared directly; updated
@bluecadet/dropsto^1.2.1 - Added Kernel test coverage for the example submodule's controllers (0% to 97%)
1.0.x
- Initial commit allowing for 3 different types of Content AJAXing
- Adding in another "trigger" type for Content AJAXing