Personalization

Liquid syntax reference

Learn valid syntax, filters, conditions, escaping, unsupported host features, and message-template restrictions.

Documentation

Liquid is the template language used to insert values and make conditional sections in Landit Pages. A Page template combines HTML with Liquid expressions.

This guide applies to Page templates. LinkedIn invitation and message templates have the separate, narrower contract described below.

Output a variable

Put the exact variable path inside double braces:

Hello {{linkedin.first_name | default: "there" | escape}}.

If the name is Jordan, the result is Hello Jordan.. If it is missing, this example uses there. Spaces inside the braces are optional.

Paths are exact and case-sensitive. Use the namespaces and identifiers described in Understand variables. A registered namespace such as linkedin does not mean every suffix exists.

Format a value with filters

A pipe applies a filter to the value on its left. A colon introduces filter arguments. Filters are applied in order:

{{linkedin.first_name | default: "there" | upcase | escape}}

This produces JORDAN or THERE. To insert a fixed value, quote it:

{{"hello" | capitalize}}

Do not put quoted template code inside a variable and expect a second evaluation. Liquid output is not processed again as a new Liquid template.

Show optional content

Tags use {% and %}. This example hides the block when the prospect company is absent or empty:

{% if linkedin.company_name != blank %}
  <p>Prepared for {{linkedin.company_name | escape}}.</p>
{% endif %}

Use else for a fallback section:

{% if linkedin.job_title != blank %}
  <p>Ideas for your work as {{linkedin.job_title | escape}}.</p>
{% else %}
  <p>Ideas for your next conversation.</p>
{% endif %}

An empty string is truthy in Liquid. Use != blank when you need to check whether optional text has content. Ordinary Liquid comparisons include ==, !=, >, <, >=, <=, and contains; conditions can use and and or. Avoid JavaScript operators such as ===, &&, and ||. Liquid condition syntax does not use parentheses for grouping expressions.

Escape text for HTML

Liquid does not automatically HTML-escape ordinary variable output. Use escape for ordinary text and quoted HTML attribute values:

<h1>Hello {{linkedin.first_name | escape}}</h1>
<img src="{{user.company.logo | escape}}" alt="Company logo">

Provide meaningful alternative text for images and check that a source image exists before depending on it. Escaping a URL is not URL validation; use a reviewed destination with an appropriate scheme.

Prompt-variable results are already HTML-escaped by Landit. Insert them directly, or use escape_once to avoid double escaping:

<p>{{prompt.personal_introduction | escape_once}}</p>

Control whitespace

A hyphen inside a Liquid delimiter removes adjacent whitespace:

Hello {{- " Jordan" -}}!

The output is Hello Jordan!. Use whitespace trimming deliberately around inline text; it can remove spaces you intended to keep.

Supported Liquid filters

These Liquid filters are supported in Landit, grouped by purpose. Use a fallback or conditional block for optional values.

Purpose Filters
HTML output escape, escape_once, h, strip_html, newline_to_br
Case and whitespace capitalize, downcase, upcase, strip, lstrip, rstrip, strip_newlines
Text operations append, prepend, replace, replace_first, replace_last, remove, remove_first, remove_last, slice, split, truncate, truncatewords
Lists join, first, last, size, sort, sort_natural, reverse, uniq, compact, concat, map, where, sum
Numbers abs, plus, minus, times, divided_by, modulo, round, ceil, floor, at_least, at_most
Encoding url_encode, url_decode, base64_encode, base64_decode, base64_url_safe_encode, base64_url_safe_decode
Fallbacks and dates default, date

h is an alias for HTML escaping. Use url_encode for a URL component; applying it to an entire destination URL also encodes its separators.

Tags and authoring boundaries

Core Liquid supports conditions (if, unless, case), assignment (assign, capture), iteration (for, break, continue, cycle, tablerow), counters (increment, decrement), output (echo), comments, raw, and ifchanged. Closing and branch tags must match the opening construct.

Use the supported variable references and examples in this guide when authoring templates.

For AI-created templates, use the available personalization fields described in Understand variables. The direct paths and conditional examples above are a starting point for your designs.

Construct Landit guidance
Direct output, core filters, and conditions Use exact available inputs; the examples above cover these patterns.
Unprefixed input such as campaign_note Supply it for each prospect; it does not populate itself.
A new dotted namespace such as campaign.headline Not a registered system namespace; do not use it in AI-generated templates.
include or render partials No customer partial-file library is configured for Page rendering. Keep the Page’s required content in the template.
Shopify-specific objects or filters Store, product, cart, theme, and Shopify asset helpers are not provided by Landit.
ERB or Ruby syntax Not evaluated by Liquid. Use Liquid’s own syntax.
A Liquid expression intended to fetch a URL Liquid does not fetch remote content for you. Supply the required data through Landit’s supported sources.

Liquid processes personalization; it is not an HTML sanitizer. HTML and browser scripts in a template are a separate concern. Do not put secrets in HTML, comments, attributes, or client-side code that will be served publicly.

LinkedIn invitation and message templates

These text templates accept only text and the following exact placeholders:

{{linkedin.first_name}}
{{linkedin.last_name}}
{{linkedin.full_name}}
{{linkedin.headline}}
{{linkedin.job_title}}
{{linkedin.company_name}}
{{linkedin.location}}
{{linkedin.linkedin_url}}

Tags and filters are not permitted in these message templates. For example, {{linkedin.first_name | default: "there"}} is not allowed there, even though it is useful in a Page template. Referenced message values must be available and nonblank when the message is rendered.

Common mistakes

Example Problem Correction
{{linkedin.firstname}} Incorrect path. Use {{linkedin.first_name}}.
{{company_name}} intended as enriched company This is a separate template input. Use {{linkedin.company_name}} for the prospect’s company.
An if block with no endif Invalid structure. Close the block.
`{{linkedin.first_name made_up_filter}}` Not a supported core filter.
A prompt tag that is blank in a template preview That preview does not run prompts. Use prompt preview or review a newly generated Page.
HTML shown literally in prompt output Prompt text is escaped. Put layout markup in the template itself.

Use supported filters and Liquid fallbacks for optional values. The preview lets you explore how those expressions appear in your design.

Further reading

The core Liquid introduction explains its syntax. The Liquid variations guide explains why examples written for Shopify themes or other hosts can rely on features unavailable in Landit. Use this Landit reference for the product-specific boundaries.

Search guides and MCP references in one place.