There are three kinds of pages in our example, the welcome pages, product list pages and a product detail page. Every page displays the navigation and the product pages additionally display a category and list of products. This data is given to our templates via the following struct:

The field Breadcrumb is used on every page to render the navigation on top. The following LoadBreadcrumb() function uses the navroot endpoint of Gentics Mesh to retrieve it.

The base.html template is the base of all pages. It includes Twitter Bootstrap, the navigation template on top of the page and below one of the actual content templates.

The welcome.html template has no magic going on, just display information about the example when accessing the index page http://localhost:8081/.

productList.html is used for displaying all products of a category. It iterates over the field Products of the given templateData struct, which was populated using the Gentics Mesh /api/v1/demo/nodes/:categoryUuid/children endpoint earlier in the handler via LoadChildren() function. The attributes of products represented as GJSON values are extracted by the template using the Get function.