Mity Docs Mity Docs for Mity Digital
Feedamic Documentation

Feeds

Support for multiple feeds was added in Feedamic v2.2.

The feeds array allows you to configure one or more feeds for your site.

This is an associative array where each feed has:

  • key, to uniquely refer to the feed

  • an array of configuration

Feed options

Each feed requires a number of configuration properties, and can optionally override your defaults too.

title

The title of your feed.

description

The short description for your feed.

routes

An array of routes for your Atom and RSS feeds.

1'routes' => [
2 'atom' => '/feed/atom',
3 'rss' => '/feed'
4],

atom and rss are the only two valid keys, and at least one is required. These will automatically be registered with your app by Feedamic.

If you do not want an atom (or rss) feed, you can remove that entry from the routes array. Make sure you have at least one route, otherwise you won't get a feed. In this example, there is an RSS feed only:

1'routes' => [
2 'rss' => '/feed'
3],

It is your responsibility to ensure these routes remain unique within your site - refer to Route Conflicts.

collections

This is how you can control what appears in each feed. Feedamic will only work with Entries from Collections, and your Collection must have "Enable Publish Dates" enabled.

This is an array of Collections - meaning your feed can either be just from a single Collection, or combine Entries from multiple Collections.

If you just wanted your feed to include Entries from your 'blog' Collection:

1'collections' => [
2 'blog'
3],

If you wanted your feed to include Entries from your 'blog' and 'news' Collections:

1'collections' => [
2 'blog',
3 'news'
4],

Entries will always be sorted by their published date, most recent first.

taxonomies

Requires v2.2.9

This allows you to filter your feed based on Taxonomies and Taxonomy Terms.

It requires an array, where each key is the handle of a Taxonomy, and then an array containing the logic (AND or OR), and an array of Term handles.

If you had a Taxonomy with the handle "tags" and the Terms of "health" and "beauty", your config could be:

1'taxonomies' => [
2 'tags' => [
3 'logic' => 'and',
4 'handles' => [
5 'beauty',
6 'health'
7 ]
8 ]
9],

This will show all Entries in your configured Collection that have the Tags taxonomy with both the "beauty" and "health" tags.

This will create a narrow feed.

You can change the logic to be OR (case insensitive) to make a wide feed - this would show all Entries with the Tags taxonomy, and has either "beauty" or "health".

You can add multiple Taxonomies, with all Taxonomy logic combined with "and" logic:

1'taxonomies' => [
2 'tags' => [
3 'logic' => 'or',
4 'handles' => [
5 'beauty',
6 'health'
7 ]
8 ],
9 'audience' => [
10 'handles' => [
11 'parents',
12 ]
13 ],
14],

This will show all Health or Beauty tagged Entries that are also for the "parents" audience.

Note that the logic parameter is optional, and when omitted, will default to "and".

query scope New

Requires v2.3.0

The scope parameter allows you to apply a query scope to Feedamic's logic. All of Feedamic's behaviour will remain, and your scope can extend it further.

The apply method of your scope will receive the feed handle and its config as the $values param.

1'scope' => \App\Scopes\MyFeedamicScope::class,

view New

Requires v2.3.0

The view parameter allows you to override both the RSS and Atom templates for the feed.

If you only need to override one template, only pass that key - if a key is omitted (i.e. you pass rss, but do not specifc an atom one) then Feedamic will fall back to its own template.

If you need to disable a specific feed type, see the routes config option.

1'view' => [
2 'atom' => 'path-to-rss-template',
3 'rss' => 'path-to-atom-template',
4]

alt_url

The alt_url is a link back to your site.

If you're using a single feed, this could just be your home page.

If you're using multiple feeds, this allows you to have each feed have a link to a different part of your site. Your blog feed could point to your site's blog home page, where as your products feed could point to your site's products index.

If omitted, your site's app_url will be used instead.

Overriding defaults

Any of the default configuration options can also be included in your individual feed configuration.

Refer to the Defaults for more details on the available default keys.

Example

Here's a quick example for two feeds - one for blog, one for news. To shorten the example, we've stripped out the comments.

1<?php
2 
3return [
4 
5 'feeds' => [
6 
7 'blog' => [
8 
9 'title' => 'My awesome blog',
10 
11 'description' => 'The awesomeness of my blog, in feed form!',
12 
13 'routes' => [
14 'atom' => '/feed/atom',
15 'rss' => '/feed'
16 ],
17 
18 'collections' => [
19 'blog'
20 ],
21 
22 'author' => false, // disable the author output for the blog feed
23 
24 // 'locales' is missing, so the default will be used
25 ],
26 
27 'news' => [
28 
29 'title' => 'Latest news',
30 
31 'description' => 'News, delivered straight to you. Well, your RSS reader anyway.',
32 
33 'routes' => [
34 'atom' => '/news/feed/atom',
35 'rss' => '/news/feed'
36 ],
37 
38 'collections' => [
39 'news'
40 ],
41 
42 'summary' => [
43 'introduction' // use the 'introduction' field for the summary
44 ],
45 
46 'limit' => 10, // only include the latest 10 news entries
47 
48 'locales' => ['en'] // only include entries with the en locale
49 ],
50 
51 ],
52 
53 //
54 // Other config options from the "Defaults" documentation
55 //
56];