# Tags

> How Liquid tags define the logic of a Shoplazza theme template: tag syntax, tags that take parameters, and the five groups of tags available.

Liquid tags are used to define the logic that tells templates what to do.

## Usage

Tags are wrapped with curly brace percentage delimiters `{% %}`. The text within the delimiters doesn't produce visible output when rendered.

In the example below, the `if` tag defines the condition to be met. If `product.available` returns `true`, then the price is displayed. Otherwise, the “sold-out” message is shown.

```liquid title="Code"
{% if product.available %}
	Price: $12.88
{% else %}
	Sorry, this product is sold out.
{% endif %}
```
```json title="Data"
{
  "product": {
    "available": true
  }
}
```

```html title="Output"
Price: $12.88
```

## Tags with parameters

Certain tags accept parameters. Some tags have required parameters, and others are optional. For example, the `for` tag can accept parameters like `limit` to exit a loop at a specific index.

```liquid title="Code"
{% assign numbers = '1,2,3,4,5' | split: ',' %}

{% for item in numbers limit: 2 %}
  {{ item }}
{% endfor %}
```

```html title="Output"
1
2
```
