Console
FunctionsCanopy

canopy.render

The canopy.render function renders a Canopy Block template directly, without any content from the Canopy editor.

{{ canopy.render(template, { ... }) }}
ArgumentDescriptionData Type
templateThe name of the block templateString
settings (optional)Setting values to merge over the template's defaultsObject

Use this function when a section should always appear with fixed content, or to preview a block template while building it. The template renders with its default setting values, and anything you pass in the settings argument overrides those defaults.

Example

index.canvas
{{ canopy.render('hero') }}
{{ canopy.render('hero', { description: 'A custom description' }) }}

Last updated on

On this page