Sign in

Filtering Post Navigation ( {{nextPost}} and {{previousPost}} ) by tag

  • This topic has 1 reply, 2 voices, and was last updated 2 weeks, 1 day ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6044
    candidexmedia

    Hi everyone!

    I’m working on creating a custom post.hbs template for a section of my website where the next post and previous post would be filtered to only display the next and previous post of a particular, specific tag (ordered by publish date).

    I know that it’s possible to create a post list from specific tags into an article, and that the {{#getPostsByTags}} helper exists, but what would be the best practice to combine {{nextPost}} / {previousPost}} with {{#getPostsByTags}}?

    I’m using the premium Documentation theme.

    #6048
    Tomasz Dziuda

    Hi,

    I afraid that at this moment preparing such feature will be quite complicated. In fact you should prepare a custom helper (https://getpublii.com/dev/tags/custom-helpers/) which uses @website.contentStructure.posts (https://getpublii.com/dev/website-global-variable/) to meet your conditions for every post. It is in my opinion possible but can be complicated to implement.

    --
    Do you appreciate the support you've received today? If so, consider donating to the Publii team by clicking here; we'll be sure to use your donation to make Publii even better!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.