> For the complete documentation index, see [llms.txt](https://cryptococo.gitbook.io/cocoshop-theme-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cryptococo.gitbook.io/cocoshop-theme-development/liquid/filters.md).

# Filters

Filters are simple methods that allow you to modify and manipulate the output of a Liquid object or variable. They can be applied to an object or variable using the pipe character `|` followed by the filter name and any optional parameters. Filters can be chained together to perform multiple operations on the data.

### Basic Syntax

The basic syntax for using a filter is:

```liquid
{{ object | filter_name: parameter1, parameter2, ... }}
```

Example: Using the `replace` filter to replace "example" with "sample" in a string

```liquid
{{ "This is an example text." | replace: "example", "sample" }}
```

Output:

```vbnet
This is a sample text.
```

### Chaining Filters

You can chain multiple filters together by adding additional pipe characters `|` and filter names with their parameters. The filters will be applied in the order they are written.

Example: Using the `upcase` filter and the `replace` filter together

```arduino
{{ "This is another example." | upcase | replace: "EXAMPLE", "sample" }}
```

Output:

```vbnet
THIS IS ANOTHER sample.
```

### Built-in Filters

Liquid comes with a variety of built-in filters for common tasks such as string manipulation, formatting numbers, and working with dates. Some examples of built-in filters include `capitalize`, `truncate`, `round`, and `date`.

Example: Using the `truncate` filter to limit a string to 10 characters

```bash
{{ "This is a very long text." | truncate: 10 }}
```

Output:

```csharp
This is a...
```

For more details on filters, including a comprehensive list of built-in filters, please refer to the LiquidJS documentation:

[LiquidJS Filters Documentation](https://liquidjs.com/filters/overview/)

By using filters in your Liquid templates, you can easily manipulate data and create dynamic content based on various conditions, greatly enhancing the functionality of your web application.
