Use scaffolding in templates for AI-generated content
Using content scaffolding, you can define places in a page template where HubSpot can insert AI-generated content. When a user generates AI content for a page that uses a scaffolded template, HubSpot will review the theme's scaffolding schema and template configuration to generate and insert more accurate content. Currently, scaffolding only works with the content remix feature.
Adding scaffolding to a template is a two part process:
- First, create a JSON config file that defines scaffolding fields where AI-generated content should be inserted, along with the type of content to insert. Currently, you can specify scaffolding fields for text and image content.
- Then, update the template to reference the schema and include scaffolding variables as needed.
The first step to adding scaffolding to a template is to create a <fileName>.scaffold_schema.json
file in your theme. This file is similar to the fields.json
file, and can be placed anywhere within the theme folder.
Flag | Description |
---|---|
name
|
The name of the scaffolding field. Use this name when referencing it in HubL under the
|
type
| Defines the format of the generated content, corresponding to the types used by theme and module fields. Supported types included |
description
| A string that describes how the field is used in the template, up to 250 characters. HubSpot will use this description to generate more accurate content. All field types require a description, except for |
Generates text content in the form of a string.
Generates image content in the form of an object. Scaffold images support the same properties as image fields, including src
, alt
, width
, and height
. The width:height ratio must be 1:1, 1:1.75, or 1.75:1.
To generate the image, HubSpot will use the descriptions defined in the scaffold_schema.json
file.
Groups fields for better structure and organization. This field type doesn't support a description
property.
With your scaffold schema file configured, you can reference within the annotations at the top of the template file.
Then, you can add your scaffold fields throughout the template as needed.
Scaffold fields are referenced using dot notation, starting with scaffold_content
followed by the group (if applicable) and field name. You should also specify a fallback or
value if this template will be used for creating standard pages. This is because scaffold_content
is null outside the context of content remix.
Thank you for your feedback, it means a lot to us.