# Liquid Templating

MeetBit uses Liquid Templating to allow dynamic customization of different features. This section is a brief guide outlining the basics of using Liquid Templating. For more in-depth knowledge, you can refer to the [official Liquid documentation](https://shopify.github.io/liquid/).&#x20;

{% hint style="info" %}
Liquid Templating is commonly used along with [Github Markdown](https://meetbit.gitbook.io/docs/others/github-markdown). In these cases, Liquid is applied first before Markdown processing takes place.
{% endhint %}

## Basics

Liquid is primarily used to display dynamic information within a "template". Liquid code is denoted by text between double curly braces(`{{ }}`).

```liquid
This is some {{ dynamic }} information.
```

Depending on where the above code is used the `{{ dynamic }}` text will change into whatever the actual value of `dynamic` is.

***

Another form of Liquid code is a tag. These are denoted by text between single curly braces(`{ }`) and the percent(`%`) symbol. These are primarily used for [Controle Flows](#control-flow) and [Iteration](#iteration).

```liquid
Hey {% if name %}{{name}}{% else %}there{% endif %},
```

## Objects

Most information in MeetBit is nested within objects. For example, if you were to display an Event's title, you would have to access it within the Event object.

```liquid
Your meeting, {{ event.title }} is tomorrow.
```

Information may also be nested within multiple levels. For example, in Notifications, your Workspace's `logo_url` is accessible under `branding` which is under `tenant`.

```
My logo is here {{ tenant.branding.logo_url }}.
```

## Operators

Operators are used in Liquid to compare two values. The following table outlines the basic operators used in Liquid.

| Operator | Operation                 |
| -------- | ------------------------- |
| ==       | equals                    |
| !=       | does not equals           |
| >        | greater than              |
| <        | less than                 |
| >=       | greater than or equals to |
| <=       | less than or equals to    |
| or       | logical or                |
| and      | logical and               |

## Control Flow

Control flow allows you to have conditional sections on your template that may or may not show depending on some value.

```liquid
Hey {% if name %}{{name}}{% else %}there{% endif %},
```

The example above displays the `name` value if the value exists and "there" if it doesn't.&#x20;

## Iteration

Liquid allows you to loop over a list of items and perform some actions on each item like displaying them.&#x20;

```liquid
{% for attendee in event.attendees %}
  {{ attendee.email }}
{% endfor %}
```

The example above will loop over each attendee of the event and display their name.

## Reference

* [Official Liquid Documentation](https://shopify.github.io/liquid/)
