# Themes - Using Content Sources

Source: https://docs.arcxp.com/en/products/themes/themes---using-content-sources.html

This document lists Content Sources that are available out-of-the-box with Themes.

Some Blocks specify a specific, named Content Source, and others specify a schema, which allows the user to choose between multiple Content Sources.

## Content Sources using the ans-item schema

These Content Sources use the **ans-item** schema. It’s used for a single Arc XP Native Specification (ANS) item - a story, a video, or a gallery.

## content-api

### Which API and endpoint are used?

Content API - [Fetch A Single Document](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

### What parameters are available?

| Parameter name   | Required or Optional? | Example value                                                             |
| ---------------- | --------------------- | ------------------------------------------------------------------------- |
| **\_id**         | Optional\*            | LW5LQMYTIFF6VDBN6PECAIVLF4                                                |
| **website\_url** | Optional\*            | /gallery/2020/02/06/historic-tour-aboard-the-international-space-station/ |

\*While both **\_id** and **website\_url** are optional, you must enter at least one of them to retrieve an item. If both are entered, **\_id** is used.

### How do I use it?

You can provide either the Arc ID or the website URL of the content item.

If your website’s URLs change frequently, or if you’re curating content across multiple websites where the URLs may differ, then **\_id** is recommended when curating stories (as it does not change, even if the **website\_url** does).

## Content Sources using the ans-feed schema

These Content Sources use the **ans-feed** schema. It’s used for a feed for ANS items - a feed of stories, videos, and/or galleries. See also [How to Set up a Feed](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html).

### content-api-collections

#### Which API and endpoint is used?

Content API - [Fetch A List Of Items From A Collection](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

#### What parameters are available?

| Parameter name     | Required or Optional?          | Example value              |
| ------------------ | ------------------------------ | -------------------------- |
| **\_id**           | Optional\*                     | EQ73B3RSGNAFXBR6JF3RNWFT6E |
| **content\_alias** | Optional\*                     | homepage                   |
| **from**           | Optional                       | 0                          |
| **size**           | Optional                       | 10                         |
| **getNext**        | Optional (defaults to ‘false’) | true / false               |

\*While both **\_id** and **content-alias** are optional, you must enter at least one of them to retrieve a collection.

#### How do I use it?

Provide either a Collection ID or a Collection Alias to retrieve the Collection. You can optionally [select the Offset](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm234641005173812) (**from**) and [number of stories](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm23464100504173) (**size**) to display.

Set **getNext** \= ‘true’ to allow for serving additional collection entries, if your **size** and collection is greater than 10\. This will allow up to 20 content entries to display on a list. 

### story-feed-tag

#### Which API and endpoint is used?

Content API - [Query For Published Documents](https://dev.arcxp.com/api/public-content-retrieval/content-api/).

#### What parameters are available?

| Parameter name | Required or Optional? | Example value |
| -------------- | --------------------- | ------------- |
| **tagSlug**    | Required              | election-2020 |
| **feedSize**   | Optional              | 20            |
| **feedOffset** | Optional              | 0             |

#### How do I use it?

See [Feed of stories with a tag](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm234641004381348).

### story-feed-author

#### Which API and endpoint is used?

Content API - [Query For Published Documents.](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

#### What parameters are available?

| Parameter name | Required or Optional? | Example value |
| -------------- | --------------------- | ------------- |
| **authorSlug** | Required              | carolyn-hax   |
| **feedSize**   | Optional              | 15            |
| **feedOffset** | Optional              | 0             |

#### How do I use it?

See [Feed of stories by an author](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm234641004779783).

### story-feed-sections

#### Which API and endpoint is used?

Content API - [Query For Published Documents.](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

#### What parameters are available?

| Parameter name      | Required or Optional? | Example value  |
| ------------------- | --------------------- | -------------- |
| **includeSections** | Required              | /news          |
| **excludeSections** | Optional              | /news/politics |
| **feedSize**        | Optional              | 15             |
| **feedOffset**      | Optional              | 0              |

#### How do I use it?

See [Feed of stories in a section](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm234641004640823)

### story-feed-query

#### Which API and endpoint is used?

Content API - [Query For Published Documents](https://dev.arcxp.com/api/public-content-retrieval/content-api/).

#### What parameters are available?

| Parameter name | Required or Optional? | Example value |
| -------------- | --------------------- | ------------- |
| **query**      | Required              | type:story    |
| **size**       | Optional              | 5             |
| **offset**     | Optional              | 0             |

#### How do I use it?

See [Advanced: Feed of stories from a query](https://docs.arcxp.com/en/products/themes/how-to-set-up-a-feed.html#UUID-14784e6e-81f8-2650-ab0d-f72ae6fefacf%5Fsection-idm234641004901168)

## Content Sources using the navigation-hierarchy schema

These Content Sources use the **navigation-hierarchy** schema. It’s used to retrieve [a hierarchy from site service](https://docs.arcxp.com/en/products/arc-xp-administration/site-service/configuring-website-navigation.html).

### site-service-hierarchy

#### Which API and endpoint is used?

Site API - [Get The Navigation Tree For A Particular Website](https://dev.arcxp.com/api/site-service/).

#### What parameters are available?

| Parameter name | Required or Optional? | Example value  |
| -------------- | --------------------- | -------------- |
| **hierarchy**  | Optional\*            | hamburger-menu |
| **sectionId**  | Optional\*            | /news          |

\*While both of these values are optional, at least 1 must be entered to retrieve information from Site Service. If no hierarchy is specified, the _default_ hierarchy is used.

#### How do I use it?

This content source has two main use cases:

1. Request a hierarchy (like _footer_ or _hamburger-menu_) to display in a Block (like the [Footer](https://docs.arcxp.com/en/products/themes/navigation-blocks.html#UUID-07c145d9-6f39-1106-fd52-5bf9cd0b5fa0%5Fsection-idm234642812842918) or [Navigation](https://docs.arcxp.com/en/products/themes/navigation-blocks.html#UUID-07c145d9-6f39-1106-fd52-5bf9cd0b5fa0%5Fsection-idm234642811925919))
2. Request a section ID, to get metadata about that section in Site Service, as well as that section’s children, to display in the [Section Title Block](https://docs.arcxp.com/en/products/themes/themes---using-results-page-blocks.html#UUID-c02a0387-fefd-b779-396d-c64b130abff4%5Fsection-idm234651511877361)

## Additional Content Sources

These Content Sources do not have a schema (they are typically one-off use cases).

### alert-bar-collections

#### Which API and endpoint is used?

Content API - [Fetch A List Of Items From A Collection](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

#### What parameters are available?

No parameters are available. This Content Source is hard-coded to request an **alert-bar** collection for the given website, in order to display in the [Alert Bar Block](https://docs.arcxp.com/en/products/themes/navigation-blocks.html#UUID-07c145d9-6f39-1106-fd52-5bf9cd0b5fa0%5Fsection-idm234642812714988).

#### How do I use it?

This Content Source is only intended for use with the [Alert Bar Block](https://docs.arcxp.com/en/products/themes/navigation-blocks.html#UUID-07c145d9-6f39-1106-fd52-5bf9cd0b5fa0%5Fsection-idm234642812714988). Follow instructions in that block’s documentation.

### author-api

#### Which API and endpoint is used?

Author API - [List Authors](https://dev.arcxp.com/api/content-administration/author-api/)

#### What parameters are available?

| Parameter name | Required or Optional? | Example value |
| -------------- | --------------------- | ------------- |
| **slug**       | Required              | carolyn-hax   |

#### How do I use it?

Provide the slug for the author to retrieve their data from the Author Service.

### tags-api

#### Which API and endpoint is used?

Tags API - [Return A List Of Only The Tags Specified By Slug](https://dev.arcxp.com/api/content-administration/tags-api/)

#### What parameters are available?

| Parameter name | Required or Optional? | Example value |
| -------------- | --------------------- | ------------- |
| **slug**       | Required              | election-2020 |

#### How do I use it?

Provide the slug for the tag to retrieve its data from the Tags Service.

### content-api-unpublished

#### Which API and endpoint is used?

Content API - [Fetch A Single Document](https://dev.arcxp.com/api/public-content-retrieval/content-api/)

#### What parameters are available?

| Parameter name | Required or Optional? | Example value              |
| -------------- | --------------------- | -------------------------- |
| **\_id**       | Required              | HADBIJEFK5G57CXZN7UC7UQHF4 |

#### How do I use it?

This content source is only intended to be used to [Preview Unpublished Stories](https://docs.arcxp.com/en/products/composer/managing-composer-settings/how-to-set-up-composer-preview-for-pagebuilder-or-headlessly.html) from Composer. It is only used in the [Preview Unpublished Stories Resolver](https://dev.arcxp.com/themes/developer-docs/themes-setting-up-resolvers/) and should not be used elsewhere, to ensure that unpublished content does not appear on the live website.
