- Issue created by @capellic
- πΊπΈUnited States capellic Austin, Texas
I dig some additional banging around and I have some progress to report:
I learned that I could test for the existence of HTMX on the page by entering `htmx` into the Chrome console. If the library is loaded on the page you get the object as a response, otherwise you get an error.
I had been under the impression that `{{ attach_library('htmx/drupal') }}` wasn't working, but I just don't think I was clicking the cache clear button hard enough. ;-)
I discovered I could enter XHTML right into the Twig file, this one was fun:
<div> <div id="response-div"></div> <button hx-get="htmx/node/105/card" hx-target="#response-div" hx-swap="beforeend"> Register! </button> </div>
Once I got confident the HTMX library was loading I experimented with lazy loading the card i the screenshot above:
{% set htmx = create_htmx() %} <div {{ htmx.get(drupal_url('htmx/node/105/card')).trigger('revealed') }}></div>
I chose "revealed" after experimenting with "load", however "load" was firing many times on the page.
I'm going to close this ticket. I hope someone else finds it useful.