Skip to content

How to create a template

Keno Dressel edited this page Jan 23, 2016 · 1 revision

How to create a template

Introduction

This CMS provides a easy plug and play template addition. You just have to place files that have a certain structure in the /templates directory.

Files

All files should be handlebar files, the file extension should be .handlebars and it should be a valid html with one wrapping tag. Also, as we are using handlebars as our default rendering engine, they should provide a valid handlebars syntax as well.

HTML Code

We are using the normal handlebars syntax with some additions to provide more options to the template creator. You can configure additional restrictions or other options directly in the html by adding data-bo-* attributes. The full list of supported additional options is here:

  • data-bo-name (String) Name your variable
  • data-bo-type (Type) Restrict the content to a certain type. Supported: string, number, file
  • data-bo-maxlength (Number) Set a maximum content length to your variable
  • data-bo-minlength (Number) Set a minimum content length to your variable

Example

<span data-bo-maxlength="5">{{title}}</span>