Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.46 KB

File metadata and controls

62 lines (46 loc) · 1.46 KB
layout title nav_order redirect_from
default
Getting started
2
/Installation.html

Getting started

{: .no_toc }

On this page

{: .no_toc .text-delta }

  1. TOC {:toc}

Installation

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.

Usage

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.