> For the complete documentation index, see [llms.txt](https://docs.scaleflex.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scaleflex.com/portals/building-a-portal/sections/gallery/gallery-settings/filters.md).

# Filters

Choose which filters visitors can apply to the gallery.

**Filters** decides how visitors narrow the gallery for themselves. It is the counterpart to **Criteria** on the [Source](/portals/building-a-portal/sections/gallery/gallery-settings/source.md) panel: criteria decide what the gallery contains, filters decide what visitors can do with it.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FC926xcUlLQ6liKWo7Jkj%2Fimage.png?alt=media&#x26;token=fa2b9741-2b99-4c5f-8c85-bb5da2ed2442" alt=""><figcaption><p>The <strong>Filters</strong> panel of Gallery settings.</p></figcaption></figure>

## The built-in filters

Four filters need no setting up beyond turning them on:

| Filter                    | Lets visitors narrow by                  | Default |
| ------------------------- | ---------------------------------------- | ------- |
| **Asset format filter**   | Format — image, video, audio, documents. | On      |
| **Asset size filter**     | File size, in MB.                        | Off     |
| **Video duration filter** | How long a video runs.                   | Off     |
| **Tags filter**           | The tags on an asset.                    | Off     |

Turn on only what the set actually varies by. A duration filter on a gallery of logos is noise.

## Display filters

**Display filters** controls the metadata filters panel — the one built from your own fields. It is **on** by default, but shows nothing until you add fields to it.

* **Add filter** opens the list of metadata fields eligible for filtering, with a search box.
* **Add all** takes every eligible field; **Remove all** empties the list.
* **Drag to reorder.** The order here is the order the filters appear to visitors.
* **×** removes a single filter.

With nothing added the panel shows **No filters yet**. Turning **Display filters** off keeps your list but hides the panel from visitors.

{% hint style="info" %}
Only fields whose type can be filtered on are offered — the ones with a fixed set of values to choose between. A free-text field has nothing to offer a filter panel and doesn't appear in the list.
{% endhint %}

## Where visitors find them

Filters sit behind the **Filters** button beside the gallery. To have the panel already open when the gallery loads, turn on **Expand filters by default** in [View options](/portals/building-a-portal/sections/gallery/gallery-settings/view-options.md).

The **Filters** button is independent of the toolbar: hiding the toolbar leaves filtering available.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F0cUN6irfZwra2tsF0u2A%2Fimage.png?alt=media&#x26;token=e1f541fc-1f6c-4f8d-89eb-ea891bb01485" alt=""><figcaption><p>And how they reach visitors — the filters panel beside the gallery on a live Portal.</p></figcaption></figure>

{% hint style="info" %}
In **Collections** display mode these filters still apply, but visitors meet them one level in: the gallery opens on the collections tree, and the filters appear once they drill into a group's assets. **Expand filters by default** isn't offered there, since there's no "on load" for the panel to open at.
{% endhint %}

## Inside a collection

A collection can be a saved search: it narrows the project down to its assets, and it may group them by a metadata field, in which case every asset in a group shares that field's value.

While a visitor is inside such a collection, filters for the fields it has already fixed are left out of the panel, and no chips appear for them. Everything else you turned on is offered as usual.

That is deliberate. The panel lists a field's **full** set of values, not only the ones in front of the visitor, so offering a field the collection has already decided would at best repeat a choice and at worst offer values the collection excludes — picking one would empty the gallery.

A clause that rules a value *out* doesn't count as fixing the field. A collection that merely excludes one category still lets visitors filter by the rest.
