Skip to content
Log in

How to render content blocks using Liquid

On this page

Wherever possible, render content blocks using relationships in Salesforce rather than Liquid. For example, place a content block on a page through the page record’s related list, or set the header or footer content block directly on the store record. Managing content through relationships means you can continue to work with it in the Website builder.

Where relationships are not supported, such as placing a content block in an article or rendering one from a theme template, use the following Liquid tag in any markdown-compatible field or theme template:

```liquid

{{ all_content_blocks[‘identifier’].render }} ```

Replace identifier with the value of the content block’s Identifier field.

Accessing content block attributes

To access specific attributes of a content block, such as its title, subtitle, or image, assign the content block to a variable and then output the attributes you need:

```liquid

{% assign content_block = all_content_blocks[‘identifier’] %}

{{ content_block.title }} ```

For the full list of available attributes, see ContentBlock - Liquid Object Reference.

Was this article helpful?

Was this article helpful?