Creating a newsletter Collection

I’ve followed instructions from the Ghost documentation, as well as other websites, and still can’t figure out how to get this to work.

I am trying to set up a collection of newsletter posts.

The goal is:

I’ve added this to the YAML file:

/newsletter/:
permalink: /newsletter/{slug}/
template: default
filter: primary_tag:newsletter

I also tried changing the template to ‘newsletter’ and created a custom newsletter.hbs file.
Nothing I’ve tried works.

Do I need to create a page in Ghost named ‘Newsletter’ does that happen automatically? I tried creating that page, but that didn’t help.

It looks like you’re close.

The YAML file is whitespace sensitive, so you need to ensure that you have an indentation after /newsletter/. You’ll also need to ensure that newsletter is the first tag on your newsletter posts. And, template should be set to index. That’s likely the culprit there.

You don’t need a newsletter or newsletter page for the custom collection to work.

1 Like

Got it. Thanks. I think the thing that fixed it was moving the newsletter collection before the default one…so…

collections:
/newsletter/:
permalink: /newsletter/{slug}/
template: newsletter
filter: tag:newsletter
/:
filter: visibility:public
permalink: /{slug}/
template: index