Collection isn't fetching posts

My theme includes a “Blog” page template. I’m trying to get that template to work for a page called “Learn” instead… essentially just switching the title of the page to Learn, switching the URL to /learn/, and having the page collect posts tagged #learn instead of #blog.

Following the Collections tutorial, I updated my routes file and created a test post tagged #blog:

Unfortunately this didn’t work. The Learn page is using the blog template, but the test post isn’t being pulled in.

I saw another thread suggesting that this issue could arise if the filters for each collection are not unique, but that conflicts with this theme’s default behavior. Normally, posts tagged #blog will appear on both the blog page and the home page index. Here is that routes.yaml, and screenshots of what the blog and home pages should look like.



So if this is indeed an issue of collection uniqueness, then I guess my question becomes: how did the theme developer make it so that posts appear on both the home page and the blog page??

Your learn tagged pages are getting included in the first collection.

I’m guessing the theme creator is using the #get helper, which ignores routing.

Thank you, that was indeed the issue. Now onto figuring out how to tinker with the home page haha.

1 Like