Hiding content collection in suggested posts


#1

I have just followed this guide to add a content collection to my blog.

I try and write 700 words each morning, and I wanted to put some of these morning scribbles online, without them being mixed in with my usual, polished blog posts.

So I created a ramblings collection, and hid any blog tagged with ramblings from the homepage. Great success.

Here’s what my routes looks like:

collections:
  /:
    permalink: /{slug}/ 
    template:
      - index
    filter: tag:-ramblings
  /ramblings/:
    permalink: /ramblings/{year}/{slug}/ 
    template:
      - index
    filter: tag:ramblings

Now I can just link to my ramblings index when I want to. They won’t be publicised much.

But I have an issue: my ramblings are now appearing at the bottom of my proper blog posts, as suggestions for what to read next. Is there any way to omit a content collection from appearing at the bottom like this?

Many thanks,
Dan


#2

Ooooh this sounds like a bug. The previous & next links should be taking the collection into account. I imagine it’s something we’ve overlooked and you’re the first person to notice it.

However, for reasons, the behaviour might go away if you swap the order of your index and ramblings collections - they are meant to work as a cascade.

cc @Kate


#3

I’d suggest for now, removing next/prev and adding your own related posts type block at the bottom of the post. A quick review tells me this isn’t a quick fix, and will likely go into a set of larger work on dynamic routing we have planned to be completed by the end of the year.


#4

Thanks for the quick reply @Hannah.

I tried swapping the ordering of the collections and unfortunately it didn’t have any effect.

I don’t know enough about Ghost to add my own related posts block yet, but I will look into it and keep an eye on new releases.


#5

I’ve raised a bug issue in Ghost:

We will work on a fix asap :slight_smile: Thanks for the report!


#6

Just in case anyone else has the same issue, I got around it by replacing:

{{#next_post}}

With:

{{#next_post in="primary_tag"}}

And the same for previous_post. You can find these two sections at the bottom of post.hbs. Now the previous/next post links only show blogs that have the same primary tag, which handily omits all blogs from my ramblings collection.


#7

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.