Download
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

  • #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 }}}

    {{/getPostsByTags}}`

    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?

    #1650
    Avatar photoBob

    Try this way:

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

    Thank you Bob! That did it.