Is it possible to render a <fragment> of a Thymele...
# http4k
m
Is it possible to render a fragment of a Thymeleaf template? I think this method in Thymeleaf's API needs to be used.
d
I don't know as we've never tried it! Let us know! 🙃
m
I don't think it's possible with the current implementation of
http4k-template-thymeleaf
.
Do we want to extend the
ViewModel
inteface to be able to return fragment separately? Perhaps other template languages can support this as well. 🤔
According to https://v1.htmx.org/essays/template-fragments/, there are other Java based template languages with fragment support, although only Thymeleaf is currently supported by http4k.
d
Thanks for adding the thymeleaf support. Until we have more than 1 case, I'm hesitant to try and abstract anything out right now 🙂
👍 1
m
Sounds reasonable.
Here is an example on how to use it: https://github.com/mikaelstaldal/htmx-http4k-thymeleaf
(Using a local copy of ThymeleafTemplates until a release of http4k is made.)
d
@Mikael Ståldal FYI 5.44.2.0 is now live with the template support. We have also repackaged and renamed the hot reload packages to a more appropriate location 🙂
👍 1
m
Thanks, upgraded to that now.