Collections not using the template I am telling it to

General info:

  • Ghost Version 4.4.0
  • Local development

I am trying to have 2 custom collections but when i set them in my routes.yaml the resulting collections do not use the template that I am telling it to use. Instead what it uses is my index.hbs (at the root of theme) Is this a bug that it only uses index.hbs or is there somewhere in my theme that is interfering with using a different template?

routes.yaml

collections:
  /blog/:
    permalink: /blog/{primary_tag}/{slug}/
    filter: tag:-hash-guide
    template: collection-index
  /guide/:
    permalink: /guide/{primary_tag}/{slug}/
    filter: tag:hash-guide
    template: collection-index
    
taxonomies:
  tag: /{slug}/

collection-index.hbs

{{!< default}}

{{#contentFor "title"}}{{meta_title}}{{/contentFor}}
<div>
  TEST
</div>
<div class='c-archive'>
  <h1 class='c-archive__title'>{{ meta_title }}</h1>
  {{#if meta_description}}
    <p class='c-archive__description'>{{ meta_description }}</p>
  {{/if}}
</div>

{{> loop }}

{{ pagination }}

I have tested it and added some static text to my index.hbs and it does show up for the collections even though I’m specifying a different template to use.

This exact thing is happening to me. I’ve debugged it all the ways I can think of. I know it’s finding my template files because some of my specified collections are using the specified templates. And if I change collection X to use an old template, it finds it. But if I tell collection X to use a new template, it defaults to the index. I’ve tried changing the names of the files, the collection, everything. It just refuses to work. Did you ever solve this?

I’m having the same issues, works in live but not local.