Skip to content

The data in a template

What record and variants contain, how to read an attribute by its code, and which page covers each of the other value types.

What a template can read, and how to read a plain attribute. For the syntax see template language basics; for the functions, the function reference.

Not sure what is available in your account? debug.dump prints the whole data structure.

record The current record — a product, or one custom entity record for a custom entity feed. In the record template and in the Text template node.
variants Every variant of the current product. Only in the record template.
sources The inputs of a field processing pipeline. Only inside the Text template node, not in a channel template.

Header and footer templates have none of these, and no functions eitherexport.*, asset.*, i18n.* and debug.* are all unavailable there.

To group variants — the usual case being color, with sizes underneath — use export.variants_by.

Each needs a function to read, and each has its own page covering the attribute and the functions together:

Attribute type Read it with Page
Translatable text i18n.t Translatable attributes in a template
Assets — images, PDFs, files asset.url Assets in a template
References to custom entity records export.load_custom_entities Custom entities in a template

export.attribute gives access to every configured attribute. (The channel’s languages — export.culture_codes — are on the translatable attributes page.)

Property Description
id Internal attribute id
name Attribute name, as shown in the app
required True if a value is required
translatable True if the value is language-specific
labels Label translations, keyed by language code
{{ export.attribute.product_name.name }}
{{ export.attribute['my-attribute'].name }}

For a translated label use export.attr_label.