# Unexpected behavior with routes

**URL:** <https://forum.ghost.org/t/unexpected-behavior-with-routes/49254>\
**Category:** Developer help\
**Created:** [August 2, 2024, 11:37pm UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254 "2024-08-02T23:37:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliverbo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/oliverbo/32/29163_2.png) [@oliverbo](https://forum.ghost.org/u/oliverbo)\
**Post date:** [August 2, 2024, 11:37pm UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/1 "2024-08-02T23:37:06Z")

</div>

I have following routes set up:

```auto
collections:
  /music/:
    permalink: /music/{slug}/
    template: index
    filter: primary_tag:music
  /newsletter/:
    permalink: /newsletter/{slug}/
    template: index
    filter: primary_tag:newsletter

```

The second one works as expected and has only the post with the primary tag “newsletter”. But the first one shows all posts, regardless of the primary tag on the index page.

Curiously the URLs are correct according to the route settings, i.e. both /music/ and /newsletter/ posts are included in the first collection.

Am I missing something?

Thank you!

---

<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:** [August 3, 2024, 12:00am UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/2 "2024-08-03T00:00:43Z")

</div>

Post your index.hbs file?

---

<div class="post-metadata">

**Author:** ![oliverbo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/oliverbo/32/29163_2.png) [@oliverbo](https://forum.ghost.org/u/oliverbo)\
**Post date:** [August 3, 2024, 12:44am UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/3 "2024-08-03T00:44:11Z")

</div>

It is the index.hbs of the default theme:

```auto
{{!< default}}
{{!-- The tag above means: insert everything in this file into the body of the default.hbs template --}}

<main class="gh-main">
    {{> "components/post-list" feed="index" postFeedStyle=@custom.post_feed_style showTitle=true showSidebar=@custom.show_publication_info_sidebar}}
</main>

```

---

<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:** [August 3, 2024, 3:22am UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/4 "2024-08-03T03:22:20Z")

</div>

Meaning Source? Source makes a #get request (it may be within the partial called in your example - see partials/components/post-list). That get request does not respect routing.

---

<div class="post-metadata">

**Author:** ![oliverbo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/oliverbo/32/29163_2.png) [@oliverbo](https://forum.ghost.org/u/oliverbo)\
**Post date:** [August 3, 2024, 5:59pm UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/5 "2024-08-03T17:59:19Z")

</div>

Thanks! I guess, I need to dig deeper here then.  
However, I’m wondering why the second route works as expected. It is the same index page. Also, is it possible to achieve the indended behaviour, displaying two separate collection, without custom templates?

---

<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:** [August 3, 2024, 6:29pm UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/6 "2024-08-03T18:29:18Z")

</div>

For Source, I there’s a ton of ‘get’ behavior going on with the index template, which calls this partial:

> <https://github.com/TryGhost/Source/blob/main/partials/components/post-list.hbs>

You may want to look at Casper instead, which does respect routing.

---

<div class="post-metadata">

**Author:** ![oliverbo](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/oliverbo/32/29163_2.png) [@oliverbo](https://forum.ghost.org/u/oliverbo)\
**Post date:** [August 4, 2024, 7:15pm UTC](https://forum.ghost.org/t/unexpected-behavior-with-routes/49254/7 "2024-08-04T19:15:23Z")

</div>

Many thanks! I’ll check out Casper.
