Having trouble getting a single page

Hello,

I am having trouble getting a single page by slug or id or filter using the #get helper.

I’m using Ghost version 3.21.1 (can’t upgrade to 3.22.1 yet due to this issue), and I tried the following to get a page with slug “my-page-slug”:

  1. {{#get “posts” filter=“page:true+slug:my-page-slug”}} (suggestion from previous post)
  2. {{#get “posts” slug=“my-page-slug” as |post|}}
  3. {{#get “posts” id=“5f027066b…” as |post|}} (since slug didn’t work, also tried to get the page by id value from the posts table. It’s also a suggestion from previous post)

None of these options above could return the page I needed. I didn’t see any errors in the log, and I couldn’t find any other info in the documentation that could solve this. Help is much appreciated!

Try using the “pages” resource instead of “posts”.

{{#get "pages" filter="slug:my-page-slug"}}
or
{{#get "pages" slug="my-page-slug"}}

1 Like

@brightthemes using {{#get “pages” filter=“slug:my-page-slug”}} works very well, thank you!!

This is great but why does the documentation completely ignore this?