Hi friends - I’m setting up a theme for Ghost which is going to use the membership bits and I’m very happy with what I’ve seen so far. One thing that’s missing, however, is full text search which is fine as I’ve been reading a lot of articles on how to do it.
Here’s the issue: when I use /ghost/api/v2/content/posts with axios, I get all my published posts, including the ones marked paid members only. This is what I want.
When I use {{#get posts}}, however, I _only get posts marked as “public” access. This seems like an inconsistency in the API and try as I might I can’t find the answer.
The reason I want to use the latter is that I have a contained amount of posts (< 50) for my site and, for speed reasons, I’d like to load up the Lunr search index with a JSON payload as opposed to an extra call after the page load.
Hi John and thank you but the problem is with #get on a page without the posts context. I tried doing {{#get "posts" visibility="all"}} and the get operation doesn’t seem to return any posts unless they’re marked “public”. In other words: the solution you suggest here doesn’t work for my situation.
If I use the API all of the posts are returned, which does solve the problem from the client side, however I’d like to speed things up using a JSON payload.
This will probably become implicit at the next major version break when it moves out of beta, atm it’s explicit for easier early development and to avoid accidents.
Perfect! Thank you - for some reason I had it in my head that the #get function would require the visibility filter in the same way you use filter. Anyway - thanks this is solved :).