Templates

The content of the page can be defined using templates, within which you can place widgets that will then load and display the data.

A template is based on HTML and uses Angular as rendering framework. Servitly provides a visual editor helping you in defining templates without coding.

Creating a Template

To add a new Template, you should:

  1. Enter the Interfaces / Templates page.

  2. Select whether you need to create a General template or a Thing Definition specific template.

  3. In case of Thing Definition, select the target Thing Definition.

  4. Press the Add Template button.

  5. Provide the template name.

  6. Press the Save button.

The name of the template must not contain spaces nor special characters, and once saved it cannot be changed.

Editing a Template

To edit a template, you can use the Servitly Visual Editor, which is composed by:

  • Design View: a synthetic representation of the template, that you can edit without coding.

  • Code View: a text editing area, where you can edit the source code of the template and do everything you want.

Note that custom content may not be recognized by the Design View; in this case a gray box is displayed, and you must keep using the Code View to edit this item.

For more details about editing templates, refer to the Template Editor article.

Override a Template

In the template list of a thing definition, you can see all the templates defined for that thing definition, as well as all the templates recursively inherited from the super thing definition.
If necessary, you can override an inherited template to customize the page content for the specific thing definition.  

You can also override templates provided by installed components of type Template.
In the list you can recognize these special templates in a different way, the row is gray and on the right side you can see the inheritance icon with the name of the element that provides the template, for example Connection (Component).

Note that if you choose to overwrite a component template, you will lose any updates or bug fixes made to the component, but you can restore the default template at any time.