Sign in
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Reversing order with #getPostsByTags doesn’t seem to work

  • This topic has 2 replies, 2 voices, and was last updated 4 years ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #1649
    Avatar photo[anonymous]

    Hey guys,

    I’m using N-tech theme and I’m trying to reverse the order of “Editor’s picks” posts by using the new syntax for #getPostsByTags helper as proposed here.

    In the DEV docs the sample code looks like this

    `{{#getPostsByTags “count=5&allowed=hidden,featured&tag_as=id&tags=1,2,3&excluded=1,2&offset=10&orderby=modified_At&ordering=asc”}}

    {{ title }}

    {{{ excerpt }}}


    My code in index.hbs looks like this by default

    `{{#getPostsByTags 5 @config.custom.editorPicksTagIndicator “”}}`

    I figure the `””` are there for filling in any custom options so now, after my presence, the code looks like this

    `{{#getPostsByTags 5 @config.custom.editorPicksTagIndicator “ordering=asc”}}`

    Unfortunately it does not work. The posts order is still “descending”. Does anyone have a clue of what I’m missing or is this a possible bug?

    Avatar photoBob

    Try this way:

    {{#getPostsByTags (concatenate "count=5&tag_as=id&orderby=modifiedAt&ordering=asc" "&tags=" @config.custom.editorPicksTagIndicator)}}


    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!

    Avatar photo[anonymous]

    Thank you Bob! That did it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Reversing order with #getPostsByTags doesn’t seem to work’ is closed to new replies.