Reputation: 1596
Is it possible to place conditions upon {{#prev_post}}{{title}}{{/prev_post}}
? re: https://themes.ghost.org/docs/prev_next_post
For example, I'd like to be able to go to the next or previous post with filter="tags:-archive"
If prev_post & next_post isn't the right path, what could produce an equivalent function?
Upvotes: 1
Views: 821
Reputation: 65
Alternatively, you can (for some time now) filter only by primary tag, like this: {{#next_post in="primary_tag"}}
Upvotes: 0
Reputation: 11
i run into similar question as well, google around but no-hope . here is my workaround right now, hope that helps.
for next_post:
{{!-- next_post to replace --}}
{{#next_post}}
{{> "post-card"}}
{{/next_post}}
{{#get "posts"
filter="tags:{{primary_tag.slug}}+id:>{{id}}"
limit="1"
order="id asc"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
for prevuius post
{{!-- prev_post to replace --}}
{{#prev_post}}
{{> "post-card"}}
{{/prev_post}}
{{#get "posts"
filter="tags:{{primary_tag.slug}}+id:<{{id}}"
limit="1"
order="id desc"}}
{{#foreach posts}}
{{> "post-card"}}
{{/foreach}}
{{/get}}
Upvotes: 1