TryGhost / docs

Ghost's official documentation
https://docs.ghost.org
MIT License
112 stars 80 forks source link

Custom ordering alias for ordering featured posts first #87

Closed ErisDS closed 5 years ago

ErisDS commented 5 years ago

At the moment, there's no way to order posts within channels or collections or get-helper lists, so that featured posts are first. This is a super common request. Instead, it requires use of the get helper, which breaks pagination, and in many use-cases still doesn't do quite the right thing.

Ideally, we want to make this possible at the API level, by changing the order query parameter.

This is already possible with the order parameter, it's just undocumented.

Url encoded form: https://demo.ghost.io/ghost/api/v2/content/posts/?key=22444f78447824223cefc48062&fields=title,featured,published_at&order=featured%20desc,published_at%20desc

Routes/get helper, etc form: order: “featured desc, published_at desc”

ErisDS commented 5 years ago

closed by https://github.com/TryGhost/docs/commit/e4aa27ff077577d9a897eb2a0bb320e39c1fc016