Skip to content
Skip to content
PGB Learn

Template variables: the settings form for your template

Define the fields people fill in, how they are grouped and shown, and which files stay locked, in the template block of your manifest.

Updated Nov 12, 2026

A template package turns a few answers into a finished site. The template block of pgb.package.json defines the form that Studio shows. This is the same form people use in Start a project from a template.

The template block

  • framework: the kind of project the template is. Use one of the supported values; the upload check lists them if yours is not accepted.
  • entry: the main file, as a relative path, for example index.html.
  • variables: the fields.
  • groups (optional): sections of the form, each with a title and the vars it holds.
  • conditions (optional): show a field only when another has a value, such as { "if": { "var": "show_pricing", "equals": true }, "show": ["pricing_note"] }.
  • locked_paths (optional): files protected by default, such as src/core/**.

Field types

text, richtext, number, color, image, file, url, email, phone, select, multiselect, boolean, collection and date.

Each field can have:

  • label, help and placeholder (up to 200 characters).
  • required (true or false).
  • default.
  • min and max for numbers, and max for text length.
  • options: for select and multiselect, one to 100 distinct choices.
  • item: for collection, the fields of each list item. Collections cannot be nested and hold up to 50 items.

Variable names are lower-case letters, digits and underscores, starting with a letter, up to 40 characters. Names that look like secrets (containing words such as secret, password, token or key) are refused: secrets never go in variables.

Example

The PGB Business Website template groups its fields as Business, Look, Content and Contact. It has fields such as business_name (a required text), primary_color (a color), logo (an image), sections (a multiselect), show_pricing (a boolean) and services (a collection of name, description and price).

How values reach your files

Studio writes the answers to pgb.config.json and replaces {{ variable_name }} placeholders in your files with the values. Files matching locked_paths are skipped by that substitution and are read-only in the editor until the owner unlocks them.

Good to know

  • Studio and the Marketplace both validate your block on upload. A mistake gives a message naming the field.
  • A good default for every field makes the preview look finished on first open.
  • You can build the form from a finished project with Publish as a template in Studio. See Export a project or publish it as a template.

More guides in PGB Marketplace