Liquid Templating

What you’ll learn:

  • How to use Liquid for dynamic content creation
  • When and where to apply Liquid in your presentations
  • Practical examples for common personalization scenarios
  • Best practices for maintainable Liquid code

What is Liquid?

Liquid is an open-source, high-performance template language created by Shopify. In Cast.app, Liquid acts as the engine that transforms your static content into personalized, data-driven presentations.

Why Use Liquid?

Without Liquid, you’d need to manually create different versions of content for each customer. Liquid automates this by:

  • Dynamic personalization - Content adapts automatically based on customer data
  • Conditional logic - Show different content based on customer characteristics
  • Data calculations - Perform math operations on your data within presentations
  • Smart recommendations - Provide relevant advice based on customer context

When to Use Liquid

βœ… Perfect for:

  • Personalizing greetings and content for different contacts
  • Showing different metrics based on customer segments
  • Creating conditional recommendations based on data thresholds
  • Calculating custom metrics from existing data fields
  • Adapting content tone for different customer types

⚠️ Consider alternatives for:

  • Simple static content (just use regular text)
  • Content that doesn’t change per customer
  • Complex business logic (handle in your data source instead)

Where You Can Use Liquid

You can use Liquid in multiple places throughout Cast.app:

  • Narrations - Personalize the voice-over script
  • Snippets - Create reusable dynamic content blocks
  • Recommendations - Customize CTAs based on customer data
  • Navigation - Dynamic menu options
  • Slides - Any text content on your slides

Getting started with Liquid

Liquid statements are built from variables, filters, and tags.

Here is an example of liquid, that personalizes the salutation.

{% if contact_name == "John" %}
	Hi Johny,  It was good to see you at the CS100 conference.
{% elsif contact_name == "Karen" %}
	Dear Aunt Karen,
{% else %}
	Hey {{ contact_name }},
{% endif %}
```

Variables contain information that you want to use, and the variables that Looker provides are described on this page.
You can further modify those values by using filters and tags, which you can read about in this [Liquid](https://github.com/Shopify/liquid/wiki/Liquid-for-Designers) guide.

There are two types of markup in Liquid: Output and Tag.

### Output markup (which may resolve to text) is surrounded by



```liquid
{{ matched pairs of curly brackets (ie, braces) }}

Tag markup (which cannot resolve to text) is surrounded by

{% matched pairs of curly brackets and percent signs %}

Output

An output statement is a set of double curly braces containing an expression; when the template is rendered, it gets replaced with the value of that expression.

Here is a simple example of output:

Hello {{name}}
Hello {{user.name}}
Hello {{ 'cast user' }}

You can find the language documentation here and here.


Table of contents