Assigning a template to a collection in routes

Newbie here, so apologies if this is common knowledge…

Trying to create a collection with a unique post template. I have the collection working, but it isn’t using the template I’m expecting, so clearly I’m doing something wrong.

collections:
  /status/:
    permalink: /status/{slug}/
    filter: tag:status
    template: status

I’m expecting it to use status.hbs from within the root theme directory, but it just uses the default.

I know I can do custom-status.hbs and select the proper template from the editor, but since all posts in this collection should use this custom template, it makes more sense to do it within routes.

What am I doing wrong?

Hey there!

Looks like you’ve got the majority of it right, but I think filter: tag:status is meant to be filter: primary_tag:status? There’s some documentation on the Ghost docs just here https://docs.ghost.org/api/handlebars-themes/routing/collections/#filtering-collections

Thanks for getting back. Actually the filtering seems to be working just fine. It’s the linking up with the status.hbs which doesn’t seem to be working. Any tips there?

Ah ok, sorry. Do you have a copy of your entire routes.yaml file? Maybe there’s some sort of conflict?

Here’s the full thing. It wouldn’t be related to the status route I have defined for the index view at the top, would it?

  /status/:
    controller: channel
    filter: tag:status
    template: index
  /reviews/:
    controller: channel
    filter: tag:review
    template: index

collections:
  /:
    permalink: /{slug}/
    filter: tag:blog
    template: index
  /status/:
    permalink: /status/{slug}/
    filter: tag:status
    template: status
  /reviews/:
    permalink: /review/{slug}/
    filter: tag:review
    template: index

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

It could be that section at the top yea, have you tried removing it? Looks like it’s defining the same things really