
Sign up to save your podcasts
Or


How can your server tell if its a regular link click or an hx-boost SPA-mode link click??
I'll tell you everything about it in these 5 minutes!
Let's your server know what the id is of the hx-target!
You need 2 things to send this request header:
1. Use the attribute: hx-target="some_id"
2. Use a DOM id as the target: some_id needs to be an id, not another css selector
You can use these headers to conditionally branch your response based on *which element* the request was triggered from
example of format:
Request Headers:
Hx-Trigger: search_input
Hx-Trigger-Name: search
An example in the wild: The Laravel blade documentation:
https://laravel.com/docs/11.x/blade#rendering-blade-fragments
We talk integrating htmx with Wordpress!
Andrew Rhyand
https://andrewrhyand.com/
Mentioned links:
HTMX movies demo: (very slick & educational)
https://htmx.andrewrhyand.com/
Author of the Wordpress/Inertia Adapter:
https://github.com/boxybird/inertia-wordpress
Alpine/Livewire in Wordpress:
https://github.com/boxybird/morph
Advanced htmx: Recap & grouping each of the 13 advanced attributes we went over this "season"
This means we have now gone through every attribute! (not counting extensions)
1. Browser & History
Hx-push-url - set your url
Hx-replace-url - replace your url, save no snapshot
Hx-history-elt - change snapshot from default to particular element
Hx-history - prevent something from being saved in the htmx snapshot
2. Customizing Requests
Hx-request - set no headers or timeout on request
Hx-headers - set custom headers, dynamic or static json
Hx-sync - allows you to set rules for multiple htmx requests at once
3. Submitting Data
Hx-validate - allows you to use validation rules outside of forms
Hx-disabled-elt - disables a button once you’ve clicked it
Hx-encoding - allows you to upload files via Ajax
4. Overriding Htmx
Hx-disable - allows you to disable htmx for user comments, posts, etc
Hx-disinherit - breaks inheritance chain for one or more attributes
5. Fun!
Hx-select-oob - lets you place element from your response wherever you want
Reddit thread with an example:
https://www.reddit.com/r/htmx/comments/1bukz76/hxselect_reset/
What if you wanted a part of your site to persist even using the back and forward on your browser?
Here is the reddit thread I mention in the episode, with an example:
https://www.reddit.com/r/htmx/comments/1bu14sg/how_to_make_a_audio_player_that_survives_the_back/
This one might actually be essential, not just an advanced attribute. Keeps you and your users from accidentally submitting things multiple times.