> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: About CMS Data Sources

## Article: About CMS Data Sources

## Article Link: https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/about-cms-data-sources.md

## Article Content:

# About CMS Data Sources

A CMS Data Source shares a collection's items with the elements on a page or section, so you can display collection data without writing code. Wix creates CMS Data Sources automatically for each collection on a site, including Wix app collections and collections from an external database.

A CMS Data Source is a Data Source, a logical component that shares state and behavior with the elements it's attached to. The Studio Two editor calls this kind of component a Data Source, and its code uses context provider APIs and React Context. For a CMS Data Source, Wix generates the context provider code for each collection, so you don't write or maintain it. You can also build your own Data Sources. Learn more in [About Data Sources](https://dev.wix.com/docs/studio-two/code-your-site/code-model/data-sources/about-data-sources.md).

## The Data Sources for each collection

Wix creates two Data Sources for each collection:

- **The collection Data Source**: Named after the collection. It shares a list of the collection's items, for elements such as repeaters, and the current item. It also shares a way to load more items, and whether items are loading. You set its sort order, its filter, and how many items it loads at a time with **Manage Source**. See [Display Collection Items](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/display-collection-items.md).
- **The item page Data Source**: Named after the collection with **(item page)** added, for example **Listings (item page)**. It shares the current item on a [dynamic item page](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/about-dynamic-pages.md).

Each item shares its field values and a link to the item's dynamic page.

When you delete a collection, Wix removes its Data Sources.

## Connect elements to a CMS Data Source

You connect elements to a CMS Data Source the same way as to any Data Source, in the Studio Two editor:

1. Attach the Data Source to a page, container, or section. CMS Data Sources are listed under **CMS collection** in **Connect Source**. For the panel, see [Connect to Source](https://support.wix.com/en/article/connect-to-source).
2. Connect an element inside it with **Connect to Data**. Under **Source**, select the CMS Data Source. For example, to show an item's title, select **Single Item**, then **Fields**, then **Title**.

   ![The Connect to Data panel for a title on an item page, with the item page Data Source as the source and Single Item as the field](https://wixmp-833713b177cebf373f611808.wixmp.com/images/ec3de5f2ad0acd04eef1c21473cc82a1.png)

For an element in a repeater, the **Source** in the **Connect to Data** panel is the repeater's items. The panel lists them as the collection's name followed by **Item List**, for example **Listings Item List**. Under **Field**, select **Fields** to show a field's value, then select the field. For the steps, see [Display Collection Items](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/display-collection-items.md). To link to an item's page instead, see [Link each item to its item page](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/display-collection-items.md#step-4--link-each-item-to-its-item-page).

## What CMS Data Sources don't do

CMS Data Sources display data. They don't add, update, or remove items, and they don't run custom queries or aggregations. For those tasks, use the [Data API](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-api/about-the-data-api.md) in code. 

An [Editor React Component (ERC)](https://dev.wix.com/docs/studio-two/code-your-site/code-model/editor-react-components/about-editor-react-components.md) can't read from or control a CMS Data Source in code. It gets the Data Source's values only through editor binding. You [connect an ERC's props](https://dev.wix.com/docs/studio-two/code-your-site/code-model/editor-react-components/about-editor-react-components.md#connecting-an-erc-to-other-components) to values that the Data Source shares, such as the current item's fields. To get collection data in an ERC's code, query it with the Data API. To share query results with several elements, [build a custom Data Source](https://dev.wix.com/docs/studio-two/code-your-site/code-model/data-sources/build-a-data-source-in-studio-two.md).

## See also

- [About Data Sources](https://dev.wix.com/docs/studio-two/code-your-site/code-model/data-sources/about-data-sources.md)
- [About Collections](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/about-collections.md)
- [Display Collection Items](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/display-collection-items.md)
- [About Dynamic Pages](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/data-sources-and-dynamic-pages/about-dynamic-pages.md)
- [Connect to Data vs. the Data API](https://dev.wix.com/docs/studio-two/code-your-site/work-with-data/introduction/connect-to-data-vs-the-data-api.md)