- Issue created by @ambient.impact
- π¨π¦Canada ambient.impact Toronto
Added section discussing the HTMX contrib module β .
- πΊπΈUnited States fathershawn New York
The module seems more low level in its goal, in that it doesn't try to progressively enhance the entire Drupal front-end, but rather to enable Ajax-like functionality for designated blocks.
The purpose of the HTMX module is two-fold:
- Provide a set of tools to make it easy to use HTMX within Drupal.
- To be an arena of innovation for bringing HTMX to Drupal core.
The HTMX Blocks are intended to be a usable example of developing a solution in Drupal. Both the admin interface and the blocks use HTMX. The module provides the following tools:
- The latest version of the HTMX library as a Drupal asset library
- The HtmxAttribute object which builds the data attributes that make HTMX work.
- JS/CSS asset loading: the same intent as Drupal Ajax - load any CSS or JavaScript in the response that is not already on the page.
- Render an entity in a given view mode and return the markup
- A route option to render a simpler html response
- Views plugins for HTMX displays and pagers
I'm excited that you are inspired to build with HTMX and interested in what you learn, especially any learning that would apply to π [POC] Implementing some components of the Ajax system using HTMX Active .
- π¨π¦Canada ambient.impact Toronto
@fathershawn Most of that I'm aware of. I think the biggest challenge in implementing the current functionality in HTMX is that we'll have to re-implement a lot of stuff that Hotwire Turbo does out of the box, but building on your module will help get there a bit faster when I (or someone reading this?) have the time and energy for it.
My impression is that HTMX seems to more of a low level toolkit that you build with - would you say that's accurate?
- πΊπΈUnited States fathershawn New York
That is accurate. As we find areas in which a utility or service would help, I've been adding them here in Drupal. I don't know anything about Hotwire Turbo. All of the methods of HTMX enhance and expand on these 5 capabilities:
- Behaviors are described within the element
- Any element can issue an HTTP request
- Any event can trigger an HTTP request
- Use all the βverbsβ of HTTP
- Target any element in the document for replacement by any element in the response
These enable a rich hypermedia based paradigm.
- π¨π¦Canada ambient.impact Toronto
It's worth taking a quick look at Turbo, if only to get a sense of what we would have to recreate with HTMX. I did a bit of poking around the HTMX docs just now and realized they have a guide for migrating from Hotwire Turbo, so that'll be handy.