---
title: "Advanced Liquid Markup"
slug: "advanced-liquid-markup"
updated: 2024-05-17T16:08:21Z
published: 2024-05-17T16:08:21Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced Liquid Markup

## Existence Exports

Offload complex comparisons to the query/recipient list as opposed to the mailing by leveraging an existence export. For instance, instead of using this nested *Liquid markup*:

```plainText
{% if {{major}} == 'Philosophy'%}{% if {{school_state}} == 'Oregon' or {{address_state}} == 'Connecticut' %}This was tough!{% endif %}{% endif %}
```

Add an existence export:

[![advance.png](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/advance.png)](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/advance.png)

Allowing for easier comparison:

```plainText
{% if {{philosophy_location}} == 'Y' %}Phew! That was much easier!{% endif %}
```

## Checking for Empty or Not Empty Merge Fields

An existence export is ideal for determining if a field is or is not empty. Liquid markup may also be used in this case.

**Note:** In the syntax below '' is two single quotes with no space between them.

```plainText
{% if {{major}} == null or {{major}} == '' %}The major field is empty!{% endif %}
```

```plainText
{% if {{major}} != null and {{major}} != '' %}The major field is not empty!{% endif %}
```

## Display HTML Content

For HTML data (e.g., an event description), add the "rawhtml" instruction to the Liquid markup merge field to display the output as HTML rather than text.

```plainText
{{description | rawhtml}}
```

This instruction is often used in a Liquid loop to display relevant data in a table format. The example below displays the event title, date, and description in a table row for every event returned by the events export or query node.

```plainText
{% for event in events %}
  
    {{event.title}}
    {{event.date}}
    {{event.description | rawhtml}}
  
{% endfor %}
```
