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.

Liquid Templating is commonly used along with Github Markdown. In these cases, Liquid is applied first before Markdown processing takes place.

Basics

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

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 and Iteration.

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.

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.

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

The example above displays the name value if the value exists and "there" if it doesn't.

Iteration

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

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

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

Reference

Last updated