Sign in

Reversing order with #getPostsByTags doesn’t seem to work

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1649
    Seblon

    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"}} <h2>{{ title }}</h2> <div>{{{ excerpt }}}</div> {{/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
    BobBob
    Support

    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!

    #1652
    Seblon

    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.