4 ms·
Can't see why you wouldn't be able to handle this with htmx. I see two scenarios: 1. User interacts triggering "/blog/foo", which should return a fragment Yo
by rmbyrro 2y ago
Can't see why you wouldn't be able to handle this with htmx.
I see two scenarios:
1. User interacts triggering "/blog/foo", which should return a fragment
You can add a "?fragment=true", or a custom header, or hidden input indicating the backend the desired behavior.
2. User's mobile browser reloads "/blog/foo"
Respond with the entire page, including the fragments as if the user had interacted each step of the way.
- dietr1ch 2y agoAnd now I'm stuck replicating htmx's behaviour on the server side? Seems doable and not that much of a hassle as fragment replacements should be simple afterall, but I'm simply running my site as a static page for now and I had to hack a redirecting extension for things to sort of work.
- _heimdall 2y agoThe "HX-Request" header is automatically included for every request triggered by HTMX. You can just check that to know if you should respond with a fragment or the full page.