CanvasFunctionsCanopy

cms_text

The cms_text function is used to define a text component which can be edited on the Canopy editor.

{{ cms_text(name, { value: '...', class: '...' }) }}
ArgumentDescriptionData Type
nameThe element identifierString
value (optional)The text content to be displayed within the text componentString
class (optional)A space-separated list of CSS classes to style the text componentString

The class variable is only accessible in the code. All other variables are available in the Canopy editor.

Text component template

<div class={{ class }}>
    {{ value }}
</div>

Rendered HTML output

<div class="text-purple-500">String passed in value</div>

Example

index.html
{{ cms_text('mytextcontent', { value: 'Blutui is pro-developer in everything we do', class: 'font-medium text-purple-500' }) }}

Last updated on