Getting started

Intro to creating custom templates and themes in the DevHub platform

HTML templating

Our themes, modules and templates are powered by a templating language called Jinja. This templating language supports variables, loops, if/else conditionals and much more that can be used to build dynamic experiences within the platform.

You can explore the official documentation and examples of Jinja here: https://jinja.palletsprojects.com/

We have various variables that are automatically available within the rendering context of Jinja so you can access attributes easily for the current Site, Business, Location or the other objects with our system.

Example accessing a Site's URL:

<p>{{ site.formatted_url }}</p>

Would render as:

<p>https://www.example.com/</p>

Macros

In addition to accessing values using Jinja syntax, we also expose a list of variables as macros (or shortcodes) that can be used.

These values can use used in your templates, but also can be used in all the other places within the platform including page titles, page names, content blocks and other areas where you can't normally add full Jinja templating logic.

You can find a full list of these macros below:

Example accessing a Site's URL

<p>${formatted_url}</p>

Would render as:

<p>https://www.example.com/</p>