> 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/source.md).

# Source

Choose which assets the gallery draws from.

**Source** is where you say which assets the gallery shows. What it offers depends on the [display mode](/portals/building-a-portal/sections/gallery/gallery-settings/display-mode.md) you picked, so set that first.

In every mode, the settings are laid out in three tabs:

| Tab          | What belongs here                                                       |
| ------------ | ----------------------------------------------------------------------- |
| **Context**  | Where the assets come from — all of them, a folder, a label, a section. |
| **Criteria** | How that set is narrowed before visitors ever see it.                   |
| **Advanced** | Drawing from another project, and folder paths that vary per visitor.   |

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FdGr3Zd4fHFcQoAfBeI0C%2Fimage.png?alt=media&#x26;token=a9fbcd38-48e7-4a0c-9ef7-e3b0ee6b83e8" alt=""><figcaption><p>The <strong>Source</strong> panel, with its three tabs.</p></figcaption></figure>

{% hint style="info" %}
**Criteria** and the **Filters** panel are easy to confuse. Criteria decide what the gallery *contains* — visitors never see them and can't undo them. [Filters](/portals/building-a-portal/sections/gallery/gallery-settings/filters.md) decide what visitors can *narrow it by* once it's on screen.
{% endhint %}

## Flat

### Context

**Asset source** decides the pool:

| Option         | Draws from                                                                                       |
| -------------- | ------------------------------------------------------------------------------------------------ |
| **All assets** | Everything in the project. No further selection needed.                                          |
| **Label**      | Assets carrying a label you pick.                                                                |
| **Folder**     | Assets in a folder you pick, with **Include sub-folders** if you want everything beneath it too. |

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FbplWnDZivP9alrnHWda5%2Fimage.png?alt=media&#x26;token=f1c860a3-f891-471a-9b84-a2c6fc2b523f" alt=""><figcaption><p>The <strong>Context</strong> tab in Flat mode, where <strong>Asset source</strong> is chosen.</p></figcaption></figure>

### Criteria

Three independent narrowings, each behind its own switch:

| Switch                 | Narrows by                                                                   |
| ---------------------- | ---------------------------------------------------------------------------- |
| **Filter by type**     | Asset format — images, video, audio, documents. Pick under **Select types**. |
| **Filter by tags**     | Tags. Pick under **Select tags**.                                            |
| **Filter by metadata** | A metadata field and the value it must hold.                                 |

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F40HL0lJaKSn6pK5E721V%2Fimage.png?alt=media&#x26;token=cf423812-1b5b-4436-92e5-7936c483215b" alt=""><figcaption><p>The <strong>Criteria</strong> tab — three narrowings, each behind its own switch.</p></figcaption></figure>

Turning a switch off clears what you'd chosen under it.

### Advanced

**Load assets from external project** points the gallery at a different project instead of the Portal's own — useful when one Portal presents assets that live in another team's project. Turn it on and search for the project by name.

**Dynamic folder path** builds the folder path from the visitor's own attributes rather than fixing it. Enter the path under **Folder path**, using variables where the value should differ per visitor, and give a **Fallback folder path** for visitors whose attributes don't resolve to anything. Use it when one gallery should show each customer only their own folder.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FFGl6WM8j1xXxUxKwx4co%2Fimage.png?alt=media&#x26;token=ffb09cf3-73be-4811-a698-26c116072d5d" alt=""><figcaption><p>The <strong>Advanced</strong> tab: an external project, and a folder path built per visitor.</p></figcaption></figure>

{% hint style="info" %}
**Dynamic folder path** is not offered on the home Portal, which has no per-visitor attributes to build a path from.
{% endhint %}

## Sections

Instead of one source, you build a list of them. Each section is a named group with its own assets and its own criteria, and visitors move between them with tabs.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F1pNnyCrlyBU4M7mlTATr%2Fimage.png?alt=media&#x26;token=78b4e634-3947-47e1-bd4c-5b0f5b7ec927" alt=""><figcaption><p>Sections mode: a list of named groups instead of a single source.</p></figcaption></figure>

* **Add new section** adds one to the bottom of the list.
* Drag a section by its handle to reorder it. The order here is the order visitors see.
* Each section's **…** menu offers **Edit**, **Clone** and **Delete**.

**Edit** opens that one section, with **Back to all sections** to return. A section has the same three tabs:

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2Fakgtkja48BCLm5ULB2AE%2Fimage.png?alt=media&#x26;token=5523879b-fab5-4909-90dd-3c5701ca8961" alt=""><figcaption><p>One section opened for editing, with its own Context, Criteria and Advanced tabs.</p></figcaption></figure>

| Tab          | Holds                                                                                   |
| ------------ | --------------------------------------------------------------------------------------- |
| **Context**  | **Section title** — the tab label visitors read — and the same **Asset source** choice. |
| **Criteria** | The same three narrowings, applied to this section alone.                               |
| **Advanced** | **Dynamic folder path** for this section.                                               |

Give every section a title. It's what the tab says, and an untitled one reads as **New section**.

## Folders

Pick the **Root folders** the gallery opens at; visitors navigate down from there and can't go above it. **Criteria** and **Advanced** work as they do for Flat, minus the dynamic folder path.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2FOro7WuWd6pPy0fEgrnd3%2Fimage.png?alt=media&#x26;token=797e9767-e667-47d4-bc27-152cbcc21230" alt=""><figcaption><p>Folders mode: choosing the root folders the gallery opens at.</p></figcaption></figure>

## Collections

Pick the collection the gallery opens at. Sub-collections are always included. **Criteria** and **Advanced** work as they do for Folders.

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2F0e6v9c8EZX27FO2fp9Mb%2Fimage.png?alt=media&#x26;token=64acd4a6-9e03-40a0-8720-12ccf5ec994f" alt=""><figcaption><p>Collections mode: choosing the collection the gallery opens at.</p></figcaption></figure>

## Labels

### Context

Pick the labels visitors can browse — **Select all** takes every label in the project, **Clear** empties the selection.

**Cover placeholder** decides what a label shows when it has no preview image of its own:

| Option              | Shows                                                               |
| ------------------- | ------------------------------------------------------------------- |
| **Accent gradient** | A gradient derived from your Portal colour. The default.            |
| **Color**           | A solid colour you choose, by swatch or hex.                        |
| **Gradient**        | A gradient you build yourself.                                      |
| **None**            | No block at all — a text-only card with the label name and a count. |

<figure><img src="https://2536208400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqsq2dR7Fjagf5eTifWZx%2Fuploads%2Fh9ixdgoshOq5RCdw3VGv%2Fimage.png?alt=media&#x26;token=a42fcff8-05be-4417-aa6b-89e97760e753" alt=""><figcaption><p>Labels mode: the labels visitors can browse, and the cover placeholder for those without an image.</p></figcaption></figure>

### Criteria and Advanced

As for Folders.
