Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

RSS feed to combine items from multiple page children

plugins

Started by Rob 7 years ago · 2 replies · 528 views
7 years ago

Hi,

I was wondering if it's possible to populate a RSS feed in Grav with a combination of multiple page children.

E.g. 'global.rss' would pull through items from /news children and /blog children

I'm hoping someone may be able to point me in the right direction if this already exists, or if there is a way to implement this.

Thanks in advance

👍 1
7 years ago

Take a look at Grav Plugin Feed. Scroll to 'Config Defaults':

You can override any of the default values by setting one or more of these in your blog list page where sub_pages is defined.

It seems you can manipulate the feed output using:
content:
items: @self.children

This should be a good starting point?

The other method would be to create your custom feed template. I haven't done that with Grav yet but have done it on WP. As long as you use the correct RSS syntax .. you can query (foreach) the subpages you would like in your feed.

last edited 05/31/19 by S Larcher
7 years ago

Hi @slarcher, thanks for the reply.

Yeah I thought modifying items would be the way to go but I can't seem to merge two collections together, e.g.
items:
'@page': '/news'
'@page': '/blog'

or
items:
'@page': ['/news', '/blog']

Not sure if anyone else has come across a similar requirement?

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 95 15 hours ago
General · by pamtbaau, 20 hours ago
1 61 19 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 356 5 days ago
General · by Duc , 6 days ago
3 44 6 days ago