handlebars.java

Handlebars.java is a Java port of handlebars. It provides the power necessary to let you build semantic templates effectively with no frustration.

Templates

Page Layouts and Content Layouts can now be configured as handlebars templates. For page layouts this can be done by selecting Handlebars Template Page from the Layout processor dropdown. For content layouts, select the Handlebars Template Content from the Content layout processor dropdown.

Helpers

This document outlines the 45+ handlebars helpers that we've made available to better allow interaction with Terminalfour. These are in addition to the many core handlebars.java helpers (apidocs).

The handlebars helpers API here is split into multiple groupings, depending on their function. Each of those groupings is outlined below in the packages table.

Partials

Partials are reusable blocks containing HTML and handlebars expressions, which can be embedded into handlebars templates. Embedding a partial within a Page Layout or Content Layout is as simple as adding a partial reference in the following form.

   {{> partialName}}
  

It is possible to define handlebars partials from the user interface in Terminalfour. This can be done by accessing the Home » Handlebars config » Handlebars partials Section and creating Content using the GH: Handlebars Partials Content Type. When adding partials, the Name of the Content Item should be alphanumeric and should not contain any spaces. We recommend the use of camelCase as a naming convention.

As handlebars partials are implemented as Content Items, they are fully version controlled.

Packages 
Package Description
com.terminalfour.publish.handlebars.helper  
com.terminalfour.publish.handlebars.helper.channel
The Channel package contains helpers that enable the developer to output information relating to the Channel being published, such as its Id or its name.
com.terminalfour.publish.handlebars.helper.content
The Content package contain a number of helpers that can be used to output general information about Content Items, such as their Id or publish date.
com.terminalfour.publish.handlebars.helper.content.element
The Element package contains helpers relating to Content Elements, including helpers to publish elements, manage files, etc.
com.terminalfour.publish.handlebars.helper.edit
The Edit package contains a few helpers to create links back into Terminalfour Site Manager, to access Direct Edit, edit the Section, etc.
com.terminalfour.publish.handlebars.helper.media
The Media package contains a single helper, the media helper, which allows Media to be published.
com.terminalfour.publish.handlebars.helper.navigation
The Navigation package contains the Navigation helper, which provides the ability to publish Navigation Objects.
com.terminalfour.publish.handlebars.helper.page
The Page package contains some general handlebars helpers relating to published pages, such as the preview helper, which allows the developer to target handlebars blocks for preview only.
com.terminalfour.publish.handlebars.helper.page.meta
The Meta package contains the meta helper, which can be used to publish predefined Meta tags taking to current Section into consideration.
com.terminalfour.publish.handlebars.helper.section
The Section package contains handlebars helpers that allow the developer to quickly publish Section related information, such as its id or name.
com.terminalfour.publish.handlebars.helper.section.meta
The Section Meta package contains handlebars helpers that allow a web developer to target Section Meta Content information and Content Layouts without the need for any Navigation Objects.
com.terminalfour.publish.handlebars.helper.url
The URL package contains handlebars helpers that output the URL of the page being processed, be that a preview or publish URL.
com.terminalfour.publish.handlebars.helper.utility
The utility package contain some utility handlebars helpers that could be useful in the context of preview or publish.