RSS Feed plugin return posts from all pages, not just one

Hey people, first time posting here.

My website has 6 pages with posts in each. I’m trying to implement the RSS Feed plugin, but it only allows me to get posts from a single page. I can’t for the love of god figure out how I can get all posts from all pages (or multiple pages) to show up in one rss feed.

What is the best approach?

This doesn’t do it for me.

echo page('kits')->children()->visible()->flip()->limit(10)->feed(array(
  'title'       => $page->title(),
  'description' => $page->description(),
  'link'        => 'blog',
));
?>```

Ah, I think I should be able to do something like this:

echo site()->grandChildren()->visible()->flip()->feed(array(
  'title'       => $page->title(),
  'description' => $page->description(),
  'link'        => 'blog',
));
?>```

Ok ignore all of this. Found an old post: RSS feed for multiple sections

This should give you everything visible, but will include the top level as well. could probably do a filter after the index() to strip those

site()->index()->visible()->flip()->feed

You can do all sorts of neat stuff, heres the cheat sheet. and help on filters

Thanks @jimbobrjames I’ve settled on:

$pages = $site->index()->filterBy('template', 'category');
$visiblePages = $pages->children()->visible()->filterBy('date', '<', time())->sortBy('date', 'desc');

echo $visiblePages->feed(array(
  'title'       => $page->title(),
  'description' => $page->description(),
  'link'        => '/',
));
?>

But now I run into the issue that the templates falls back on defaults, and not the values I’ve set in the array. So It won’t show a description in the rss. And if I remove the value from the array, nothing happens. Maybe you have an idea of why that is.

37

I’ve asked the question here: Feed Plugin cdata is empty

Somehow this doesn’t look ideal from a performance point of view. What exactly is your structure and what pages in the structure are you trying to fetch? If the parents of the children you want to fetch are on the top level, I wouldn’t go through the complete index, but do this:

$feedPosts = $pages->filterBy('template', 'category')->children()->visible()->filterBy(‘date’, ‘<’, time())->sortBy(‘date’, ‘desc’);