Creating a template
On this pageShowHide

Creating a template

The steps in this group use the Trustisto CLI. Install it and log in first.

Shell
trustisto template new ./my-popup --type popup

template new creates the folder and fills it with the base package for the type. --type takes:

Type In the panel
popup Overlay
topbar Bar
mail Mail

The command asks which categories the template belongs to. Pass them with --categories to skip the question, comma separated:

Shell
trustisto template new ./my-mail --type mail --categories increase,connect
Category Meaning
collect Collect contacts
increase Increase sales
guide Guide visitors
connect Connect with clients

The folder must not exist or must be empty, so template new never overwrites your work.

What is inside

Text
my-popup/
├── assets/
├── index.html
├── manifest.json
├── package.json
└── thumbnail.png
  • index.html is the template itself. See index.html for parameters, loops, CTAs and forms.
  • manifest.json describes the template to the panel: name, type, categories and the parameters the user can personalize. See manifest.json.
  • thumbnail.png is the picture shown in the template picker. See thumbnail.png. A mail template does not need one.
  • assets/ holds images, styles and scripts. Link them with relative paths, for example assets/logo.png.
  • package.json has npm scripts for the commands below, so npm run start, npm run validate and npm run deploy work inside the folder. It is not uploaded.

template new sets type and categories in manifest.json. Change the name there before you deploy: it is the name shown in the panel.

The base packages are public, in the trustisto-template repository, one folder per type.