4 ms·
One minor thing. This is not an issue directly with htmx, but more on the backend. This always feels clumsy for me: I land on the index page, and get the full
by phplovesong 3y ago
One minor thing. This is not an issue directly with htmx, but more on the backend. This always feels clumsy for me:
I land on the index page, and get the full site, then click on about page, and now htmx swaps the content for the about page. However if i refresh the url stays the same, but i now only get the content without the container.
I know this can be solved with checking for a htmx header, but i feel like "there must be a better way" like raymond httinger of python fame has said multiple times.
- recursivedoubts 3y agoi typically have a middleware component that decides whether to render the "chrome" around a given response, so my controller methods aren't junked up with it worth thinking more about though
- dgb23 3y agoThis annoyed me a bit but it's not a big deal. You make two skeleton templates: One for full documents, one that has nothing in it except the parts that change (say, the meta > title, the body > main and the body > header > nav parts) each wrapped in a hx-swap-oob. In general, out of band swaps are really, really convenient for non-hierarchical layout relationships.
- aszen 3y agoThis can be solved by returning the full about page always, but swapping only the content part of in the index page by selecting which element to swap from the requested page. Htmx supports it