Is there a way to show children and grandchildren inside an RSS Feed? My theory is that I can use either filterby() and use templates, or somehow create an array before creating an RSS Feed, but I don’t know how to structure the actual RSS Template. I’ll put this here, because it shows everything I am trying to accomplish (even though I’m sure it’s completely wrong), but hopefully this makes sense to someone!
For a little more background, I am creating a portfolio that has two template types, portfolio.single and portfolio.page (which can have more projects nested). I only want portfolio.single and posts from the blog to show in the main RSS Feed.
Well, yes, you need the second code block as well, I just copied the relevant part.
Is the link in the feed array correct? Maybe in your case it would make more sense to access the feed on the first level, not below blog, because you combine stuff from multiple pages? But that is of course up to you.
Since you sort the posts before calling the $posts->feed() method, the issue shouldn’t be in the feed plugin. The change you made only refers to the feed output.
Have you verified that your time field is actually called time? Also, please note that the times are compared as strings, they are not parsed as actual time values, which generally makes the sorting behave in a strange way. It should work though if you use 24 hour times and add zeros to one-digit values (09:01 for example).
There’s also another possible issue. I had a look at the feed plugin and the items are again sorted within the plugin (if only by date). So maybe they should not be sorted before …
I checked all of the content files, and all of the times are using a 4-digit 24-hour string. Removing line 30 seems to break the feed, and adding another string for time doesn’t seem to change anything.
// sort by date
$items = $pages->sortBy($options['datefield'], 'desc');
$items = $pages->sortBy($options['timefield'], 'desc');
Strange because all of the posts on the site are ordered correctly. The feed seems to be sorting by date and then sorting by the post number for children.
Update: Because I’ve been trying to figure out the time issue, I went around to see how things are ordered currently in the content folder. The latest posts are ordered as followed: