# Custom Block Development and Outbound Feeds

Source: https://dev.arcxp.com/arc-io/developer-docs/custom-block-development-and-outbound-feeds/

Themes enables you to use the existing Arc XP Outbound Feeds (OBF) blocks in your repository by listing them in the [blocks.json](https://dev.arcxp.com/arc-io/developer-docs/updating-blocksjson-and-outbound-feeds-development/) file. Themes also makes it possible to modify the Arc OBF Blocks to change the way they work, or to create completely new custom feeds. Because OBF is based on themes which is based on fusion, a basic understanding of the Fusion Development Process is recommended. But don’t worry, even if you are not currently using themes, you can still use OBF.

## Blocks

Outbound Feeds is based on blocks, which are just npm packages. A block can be any fusion component or content. OBF blocks are either features which generate the output and end with “-feature-block” or they are content sources which call API’s to get data and start with “feeds-source-”. There is a third type, a custom output-type, but it is not technically a block.

## Features

All OBF feeds are features intended to be the only thing on a page or template. No layout or other components need to be added to the page. The feature blocks have the following structure.

```
CHANGELOG.md
README.md
features/
   │
   └───rss
       │
       __snapshots__
        xml.js
        xml.test.js
index.js
package.json
```

In the features directory is a single directory holding the feature code and tests. The feature code will always be called `xml.js`. The feature code returns an object that gets converted to xml by the `output-type`.

Each feed block is organized using the same structure described in [Feature Blocks Architecture in Outbound Feeds](https://dev.arcxp.com/arc-io/developer-docs/feature-blocks-architecture-in-outbound-feeds/). Feed blocks use several javascript [dependencies](https://dev.arcxp.com/arc-io/developer-docs/dependencies-and-outbound-feeds-development/) to make it easier to work with Arc XP Native Specification (ANS) and xml. To reduce the amount of duplicate code in blocks, you can use the [Utilities for Outbound Feeds development](https://dev.arcxp.com/arc-io/developer-docs/utilities-for-outbound-feeds-development/).

## Content Sources

All feeds are designed to work with globalContent returned as a “results set”, an object with a `content_elements` array of content. Usually this content comes from Content-API. For this we have the `feeds-source-content-api-block` [Content Source Block](https://dev.arcxp.com/arc-io/developer-docs/content-source-blocks-in-outbound-feeds/).

## Output-Types

There is a npm package for the xml [Output-Type](https://dev.arcxp.com/arc-io/developer-docs/outbound-feeds-development-output-types/) called `@wpmedia/feeds-xml-output`, but you must use it like a regular npm package by listing it as a dependency in the `package.json` file.

If you want to modify a block you will first need to copy the code from the [feed components repository](https://github.com/WPMedia/feed-components/tree/develop/blocks) and add it into your repo. This is known as [ejecting a block](https://dev.arcxp.com/arc-io/developer-docs/ejecting-a-block-with-outbound-feeds/). Once the code is in your local repo it will no longer receive updates from Arc. Now you can start changing the code to make your custom feed. See [Setting up new Outbound Feeds repositories](https://dev.arcxp.com/arc-io/developer-docs/setting-up-new-outbound-feeds-repositories) to get started setting up your local repo.
