How to add related sidebar to an article filled with other articles

Solved: Version 0.8.4 solves this issue by letting you add multiple=true to the section that you would like to see multiple of.

I am trying to create a ‘related’ category next to each article that lists out the most recent articles. I’ve created a blog page that has cards with permalinks to their own article page. In that article page, I want a sidebar with ‘most recents’ or ‘related’ with links to the other articles. But I’m not sure how to get all other posts to come up. It seems that since I’m using the template _blog.html to generate each article page, any reference to the {{#section blog}} refers only to that same post. So the only post that shows up for ‘related’ or ‘most recent’ is the post that I’m on.

Is there anyway to make this happen?

The only way i’ve found to do that, is to have another page return just that one bit, and load it with javascript, unfortunately…

@obi_1jacobi: Thanks for letting me know about this, and sorry for the slow response.

The issue you’re seeing is related to an old bug that was never squashed. I just published v0.8.4 which should fix the problem. Now, you can add multiple=true to the sidebar section tag, and it will force that section to render all of the articles.

To update to the latest version of Vapid, run:

npm install -g @vapid/cli

Let me know if it worked for you.

1 Like

This did work for me. Thank you for the quick update! Also would be lovely to be able to filter out the article who’s page you’re on, but I can accomplish that with javascript for now.

1 Like