Handlebars templates

Table of Contents

Overview

The Gentics Portal | java uses the Handlebars.java implementation of Mustache as its template engine.

With Handlebars one can access values in a context via the {{ …​ }} notation. For example the template

<p>
    Hello {{ firstname }} {{ lastname }}!
</p>

applied to the context

{
    firstname: "John",
    lastname: "Doe"
}

would yield the result

<p>
    Hello John Doe!
</p>

The Handlebars documentation​[1] provides more detailed examples, of simple expressions as well as how to use helpers.

Context variables

  • data

  • loggedin

  • navigation


1. The page covers the JavaScript version of Handlebars, but the syntax in the templates as well as the default helpers are the same.