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.
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 exampleindex.html.variables: the fields.groups(optional): sections of the form, each with atitleand thevarsit 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 assrc/core/**.
Field types
text, richtext, number, color, image, file, url, email, phone, select, multiselect, boolean, collection and date.
Each field can have:
label,helpandplaceholder(up to 200 characters).required(true or false).default.minandmaxfor numbers, andmaxfor text length.options: forselectandmultiselect, one to 100 distinct choices.item: forcollection, 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
Browse and search PGB Marketplace
Find agents, tools, integrations, functions, templates and workflows by type, category, portability and keyword.
Trust labels and portability levels explained
What Official, Verified Publisher, Security Checked, Featured and Community each mean, and what Portable, Compatible and PGB Native tell you.
Review permissions and install a package
Choose where a package goes, read exactly what it can access, fill in its settings and confirm the install.
See and remove what you have installed
The My installs page lists every package you installed and anything installed on projects you manage, with an Uninstall button.
Become a publisher and add your team
Create a publisher, understand names and roles, and invite teammates to publish with you.
Write the package manifest (pgb.package.json)
The one file that describes your package: name, type, version, permissions, settings and secrets, with the rules each field must follow.