Console
FunctionsCanopy

canopy.head

The canopy.head function outputs the head sections of the Canopy Blocks rendered in a block area.

{{ canopy.head(handle) }}
ArgumentDescriptionData Type
handleThe block area identifierString

The function collects the {% canopy head %} sections of every block template used in the area, so you can place block-specific stylesheets and meta tags in your page head. Each template's head section is included once, no matter how many blocks in the area use it.

Use the same handle you pass to canopy.blocks. If the area is rendered with an explicit template list, the head sections for those templates are returned.

Example

<head>
  <title>My Site</title>
  {{ canopy.head('main') }}
</head>
<body>
  {{ canopy.blocks('main') }}
</body>

Last updated on

On this page