# Understanding Collections

**URL:** <https://forum.ghost.org/t/understanding-collections/39051>\
**Category:** Themes\
**Created:** [June 9, 2023, 6:48pm UTC](https://forum.ghost.org/t/understanding-collections/39051 "2023-06-09T18:48:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisM](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/chrism/32/24817_2.png) [@ChrisM](https://forum.ghost.org/u/ChrisM)\
**Post date:** [June 9, 2023, 6:48pm UTC](https://forum.ghost.org/t/understanding-collections/39051/1 "2023-06-09T18:48:10Z")

</div>

I set up routing and custom collections like this:

```auto
routes:

collections:
  /:
    permalink: /article/{slug}/
    template: index
    filter: 'tag:hash-article'  
  /podcast/:
    permalink: /podcast/{slug}/
    template: index
    filter: 'tag:hash-podcast'

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/

```

In my index.hbs file, I want to show a section with the latest articles and a section with the latest podcasts.

I have this and it works fine for articles:

```auto
<div class="gh-postfeed">
    {{#foreach posts from="6"}}
         {{> "card" page=../pagination.page }} {{!-- partials/card.hbs --}}
   {{/foreach}}
</div> 

```

To add posts, I add this:

```auto
<div class="gh-podcast">
 {{#get "posts" filter="tags:hash-podcast" include="authors,tags"}}
    {{#foreach posts}}
        
         {{> "card" page=../pagination.page }} {{!-- partials/card.hbs --}}
    {{/foreach}}
 {{/get}}
</div> 

```

That places the block, but also adds it to the articles list at the bottom. I tried to solve it by doing this:

```auto
<div class="gh-postfeed">
    {{#get "posts" filter="tags:hash-article" include="authors,tags"}}
        {{#foreach posts from="6"}}
              {{> "card" page=../pagination.page }} {{!-- partials/card.hbs --}}
        {{/foreach}}
     {{/get}}
</div> 

```

However that just loops 6 articles and then puts the podcast at the bottom.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 10, 2023, 10:51am UTC](https://forum.ghost.org/t/understanding-collections/39051/2 "2023-06-10T10:51:24Z")

</div>

So that routes.yaml will produce a page using the index template at /article/ that contains posts with the #article tag, and another index page at /podcast/ with the #podcast tag. Those posts will get automatically available and you can loop over them with {{#foreach}}, without needing a {{#get}}. And pagination will ‘just work’, which is nice.

You can definitely use {{#get}} to load additional posts into the index page like a latest or related section. It may be helpful in that case to use the ‘as’ syntax in your gets, like some of the examples here: [Ghost Handlebars Theme Helpers: get](https://ghost.org/docs/themes/helpers/get/)

That’s pretty general, and maybe not what you need for help. I’m not sure I 100% understand what you’re trying to accomplish (and am being hindered by not knowing what theme this is). Can you post a clearer description of what you’re trying to accomplish (a picture would really help!) and maybe a little more of your index.hbs file that includes both of these sections in it?

---

<div class="post-metadata">

**Author:** ![ChrisM](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/chrism/32/24817_2.png) [@ChrisM](https://forum.ghost.org/u/ChrisM)\
**Post date:** [June 12, 2023, 4:15pm UTC](https://forum.ghost.org/t/understanding-collections/39051/3 "2023-06-12T16:15:54Z")

</div>

Thanks Cathy. It is making sense now. I was getting tripped up on the fact that {{get}} doesn’t do paging automatically. I also now understand routes a bit better.

I have been able to successfully create a home page with different post types filtered by internal tags.
