# Dynamic sources

> Let merchants bind a Shoplazza Theme section or block setting to a metafield or a resource attribute, and see which setting types support dynamic sources.

Settings for sections and blocks included in a [Liquid template](/docs/theme/architecture/templates/liquid-templates) have the option for merchants to connect one or more dynamic sources to the setting, depending on the setting type.

A dynamic source can be either:

*   A metafield value
*   A resource attribute

**note**

Dynamic sources aren't available for general theme settings.

## Available values

Shoplazza determines the value of each available dynamic source type based on the following:

*   The resource is associated with the template that the section is in.
*   The resource settings in the context of the current setting.

For example:

| Conditions | Description |
| --- | --- |
| The section is included as part of the [product template](../templates/product) | Metafields and attributes related to the product will be available for the following:<br>*   The section's settings<br>*   The settings for any block in the section |
| The section includes a [collection type setting](./input-settings#collection) | Metafields and attributes related to the collection will be available for the following:<br>*   The section's settings<br>*   The settings for any block in the section |
| The section's blocks include a [product type setting](./input-settings#product) | Metafields and attributes for that product will be available for the block's settings. |

The following table lists the available resources and their associated attributes:

| Resource | Attributes |
| --- | --- |
| [product](/docs/theme/references/liquid/objects/product) | *   `title`<br>*   `vendor` |
| [collection](/docs/theme/references/liquid/objects/collection) | *   `title`<br>*   `image` |

**note**

More resources and resource attributes will become available in the future.

The following outlines which [setting](/docs/theme/architecture/settings/input-settings) and [metafield types](/docs/theme/theme-features/custom-data/metafields/type) will be compatible:

| Setting | Metafield(s) |
| --- | --- |
| `collection` | *   `collection_reference` |
| `color` | *   `color` |
| `image_picker` | *   `file_reference` |
| `page` | *   `page_reference` |
| `product` | *   `product_reference` |
| `richtext` | *   `single_line_text_field`<br>*   `multi_line_text_field`<br>*   `number_integer`<br>*   `number_decimal`<br>*   `date`<br>*   `date_time`<br>*   `weight`<br>*   `volume`<br>*   `dimension`<br>*   `rating` |
| `text` | *   `single_line_text_field`<br>*   `number_integer`<br>*   `number_decimal`<br>*   `date`<br>*   `date_time`<br>*   `weight`<br>*   `volume`<br>*   `dimension`<br>*   `rating` |
| `url` | *   `url` |

## Default values

You can configure a setting's default value to reference a dynamic source. However, only do this if you're rendering a section or block in a context where the dynamic source value exists. For example, don't use a product-related value in a section that:

*   Can be rendered in non-product templates.
*   Doesn't explicitly have a `product` type setting to provide the necessary value.

Additional Liquid is invalid when using this method, so you can only reference the value directly. If you include additional Liquid, then you'll get an error.

The following is an example of a `default` setting that references a dynamic source:

```json
{
  "type": "text",
  "id": "featured_product_title",
  "label": "Featured product title",
  "default": "featuring: {{ product.title }}"
}
```
