Thymeleaf Layout Dialect - Sitemesh-like page composition

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Thymeleaf Layout Dialect - Sitemesh-like page composition

Emanuel
Administrator
I wanted to share a new Thymeleaf dialect that I created originally for my personal website.  Some past forum posts have asked about JSF-like page composition or creating common templates for pages, and I've answered by giving some guidance on extending Thymeleaf to do it, or giving them the code from my site that does it.

So I thought that I'd extract that part of my website code, clean it up so it works as a standalone library, then put it up on GitHub so that others can make use of it.

Thymeleaf Layout Dialect
https://github.com/ultraq/thymeleaf-layout-dialect

If you've ever used SiteMesh, then the goals of this dialect are pretty much the same: it allows you to specify an overall layout/decorator page that you can apply to your content pages, the difference being that you configure your layout/decorator and content pages with new attributes, layout:decorator and layout:fragment, directly in your HTML code instead of in web.xml and sitemesh.xml files.

Basic documentation and an example on how to use this dialect can be found on the GitHub link above.  Any comments/questions, feel free to ask.

Emanuel
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf Layout Dialect - Sitemesh-like page composition

danielfernandez
Administrator
Emanuel, this looks terrific. Really nice job, thanks a lot for the effort!

Enhanced layouting is probably number one wish for a big amount of Thymeleaf users, who do not like the standard include/substitute technique, or maybe simply prefer a different approach. So this helps a lot.

I will study your library very carefully along the next days and get in contact with you.

Besides, I am also working in an integration with Apache Tiles 2 (2.2, specifically) which will be a part of a new subproject called "thymeleaf extras". It's being quite a hard job to integrate Thymeleaf with Tiles --unfortunately, it is quite hard to integrate anything with Tiles--, but I hope to publish it soon, probably next week. http://www.github.com/thymeleaf/thymeleaf-extras-tiles2

So your dialect and the new Tiles integration altogether should conform a very nice set of tools for layouting in thymeleaf. The more options the better!

Regards,
Daniel
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf Layout Dialect - Sitemesh-like page composition

autra
This is great !

Can I ask if it will be integrated in Thymeleaf ?
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf Layout Dialect - Sitemesh-like page composition

Emanuel
Administrator
I'm glad you like it :)  But no, this won't be made a part of the core Thymeleaf functionality.  I've since become a part of the Thymeleaf dev team, so I'm up to date with a lot of the future plans and you can be sure my dialect will continue to have good integration with Thymeleaf.