Collection does not display any info, template issue?

Following this tutorial: https://ghost.org/tutorials/content-collections/

I’m trying to make a subcollection for Books, where if I go to /books, it will display all the posts with the tag books.

Here’s my routes.yaml

routes:
  /painting/:
    controller: channel
    filter: tag:[Knigi]
    template: books
  /apple-news/:
    controller: channel
    filter: tag:Knigi
    template: index    
collections:
  /:
    permalink: /{slug}/
    template: index
    tag: -[hash-books]
  /mybooks/: 
    permalink: /mybooks/{slug}/
    template: index
    filter: tag:Knigi
  /thebooks/: 
    permalink: /thebooks/{slug}/
    filter: tag:books

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

I’ve been trying to achieve the functionality both by routes and collections, but I cant get it to work.

The issue is, when I now point the browser to /books, or /thebooks or /painting or /apple-news, I get an empty template page. No posts are loaded.

However, if I open /tag/books I can see that there are two posts fitting that description.

I’ve tried different templates, Casper, Massively, Edge, Headline, but nothing happens.

What am I doing wrong?

Technical details about setup:
Ghost URL: Localhost
Ghost version: Ghost-CLI version: 1.24.0
Ghost version: 5.39.0
Node version: v18.12.1
Not sure how to see issues in the console.

filters for channels are like filter: tag:[tagslug] - the capitalized tag in your /painting/ is incorrect, and I while you don’t need the [ ] in your second example, you DO need the slug form of the tag, which is not capitalized.

Do you actually have tags called #books and books? You might, but I wonder if this is an error. You’re excluding #books from your / collection, then trying to include books (no #) in your thebooks collection.

1 Like

No, it’s just books, no # in there. I was reading the forums that said local searches needed to include hash in the search, but maybe I missunderstood.

I see now that I didnt have filter in there, just tag, my bad.
I also got one of the routes to work, this one:
/apple-news/:
controller: channel
filter: tag:knigi
template: index

So thank you so much for the support!

The hash-books notation means the tag #books.