layout | title | nav_order | redirect_from | |
---|---|---|---|---|
default |
Getting started |
2 |
|
{: .no_toc }
{: .no_toc .text-delta }
- TOC {:toc}
A minimum of Java 8 and Thymeleaf 3.x is required. Add the layout dialect by configuring Maven or your Maven-compatible dependency manager to the following co-ordinates:
- GroupId:
nz.net.ultraq.thymeleaf
- ArtifactId:
thymeleaf-layout-dialect
- Version:
3.3.0
Check the project releases for a list of available versions. Each release page also includes a downloadable JAR if you want to manually add it to your project classpath.
Configure Thymeleaf to include the layout dialect using one of the methods below:
-
Spring or Spring Boot w/ Java/annotation config:
@Bean public LayoutDialect layoutDialect() { return new LayoutDialect(); }
-
DIY management of the Thymeleaf template engine:
TemplateEngine templateEngine = new TemplateEngine(); templateEngine.addDialect(new LayoutDialect());
This will introduce the layout
namespace, and 5 new attribute processors that
you can use in your templates: decorate
, title-pattern
, insert
, replace
,
and fragment
.
Continue on to the [processors]({{ site.baseurl }}{% link processors/index.md %}) section to learn how to use these in your templates.