Skip to content
Strife Docs

Reference Field Reference

fields.contentTemplate()

Embeds a single content template's fields inline.

Embeds a single content template's editors inline. Maps to editor { name: 'str-content-template', type: 'content-template' }. The stored value is the embedded template's data object.

Example

TypeScript
fields.contentTemplate({
  label: 'Call to action',
  template: 'cta-block',
})

Options

OptionTypeRequiredDescription
label
string
Yes
Label shown to editors in Strife Studio.
template
string
Yes
The defineType name of the content template to embed. Compiled to wire attributes.templateId as the template's normalized (kebab-cased) name — the frontend resolves it by normalizedName, so no server-assigned GUID is required.
localizable
boolean
No
One embedded object per language. Only on a field at the top level of the type: a content template inside another embed is never per language.
propertyName
string
No
Override the stored property name.

Without localizable, the embedded block holds one value shared by every locale, and localizable on a field inside the embedded template has no effect. See Languages inside a chapter.

Output type

unknown from a bare Infer<> on the type that declares it — strife typegen resolves template to the embedded type's actual generated interface, so the generated read type is correctly typed even though the DSL-level Infer<> isn't (recursive item inference is a v2 concern, same as fields.chapters()).

See also

  • Content Template — the same editor, documented from the Strife Studio UI side.