This is a community driven project to support various view templating technologies other than FreeMarker in Hippo CMS Delivery tier web application.
This project consists of the following submodules:
Core APIs, Utilities and base classes.
Features:
org.onehippo.forge.templating.support.core.servlet.AbstractHstTemplateServlet
#clearTemplateCache()
of the specific implemenation servlets.TemplatingPropertyRepresentationFactory
overriding the defeault org.hippoecm.hst.pagecomposer.jaxrs.api.PropertyRepresentationFactory
to allow template switching
even between Handlebars or Thymeleaf in the component parameter setting dialog.Handlebars view technology supporting servlet and other utilities.
Features:
org.onehippo.forge.templating.support.handlebars.servlet.HandlebarsHstTemplateServlet
,
supporting WebfileTemplateLoader
(webfile:...
),
ClassPathTemplateLoader
(classpath:...
),
ServletContextTemplateLoader
based on protocol prefixes.See Install page for detail on how to use it in your project.
Thymeleaf view technology supporting servlet and other utilities.
Features:
org.onehippo.forge.templating.support.thymeleaf.servlet.ThymeleafHstTemplateServlet
,
supporting WebfilesTemplateResolver
(webfile:...
),
ClasspathTemplateResolver
(classpath:...
),
ServletTemplateResolver
based on protocol prefixes.See Install page for detail on how to use it in your project.
By default, the Switch Template Support feature in the product supports only FreeMarker templates.
If you want to support the feature for your templates in either Handlebars or Thymeleaf,
simply copy the template-support.xml in the demo project
into cms/src/main/resources/META-INF/hst-assembly/overrides/addon/org/hippoecm/hst/pagecomposer/
folder.
Then you will be able to switch templates in either Handlebars or Thymeleaf:
You can build the module locally first in the project root folder.
$ mvn clean install
And you can build and run the demo project:
$ cd demo
$ mvn clean verify
$ mvn -P cargo.run
Visit http://localhost:8080/site/.
You will see some examples rendered by different templates other than FreeMarker in the page.