How to extend Thymeleaf

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

How to extend Thymeleaf

jbellmann
Hi,

is there an early draft how to extend thymeleaf?
Is there a way to do same things as with taglibs?

Thanks
Jörg
Reply | Threaded
Open this post in threaded view
|

Re: How to extend Thymeleaf

danielfernandez
Administrator
Hello,

I've just added to http://www.thymeleaf.org/documentation.html a link to a very very very early version of the "Extending Thymeleaf" tutorial, including an example of the creation of a very simple custom dialect.

It's not much (I need time to complete it, add format, etc.), but it could be enough for you as a first step.

Note: although the example dialect created in the tutorial is created from scratch and includes only one attribute processor, if you plan to create your own dialect you will also be able to extend the bundled Standard or Spring dialects, adding your own features to the ones in those dialects (you can even change the prefix if you dont like all those "th:"! ;-))

Of course, don't hesitate asking any questions about this topic in this forum.

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

Re: How to extend Thymeleaf

Zemi
Administrator
I am trying to follow the "Extending Thymeleaf" tutorial but using Spring. Is it possible?

I cannot change SpringThymeleafTemplateEngine dialect because it is protected via Exceptions, and I cannot change ThymeleafViewResolver templateEngine because of the setTemplateEngine() method signature.

Do I have to implement from scratch my own ViewResolver?
Reply | Threaded
Open this post in threaded view
|

Re: How to extend Thymeleaf

Zemi
Administrator
I finally got it working duplicating and adapting the code of SpringThymeleafTemplateEngine and ThymeleafViewResolver, but it would be nice if we could use SpringThymeleafTemplateEngine.setDialect() method.

Reply | Threaded
Open this post in threaded view
|

Re: How to extend Thymeleaf

danielfernandez
Administrator
Hi,

Could you please add a feature request for this?

https://sourceforge.net/tracker/?group_id=509826&atid=2072662

Thank you very much.

Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: How to extend Thymeleaf

Zemi
Administrator
Created feature request

Thanks for your work!