Find a page

Hello, is there any setting I have to make in the front matter to make a page searchable.

I have a directory xyz under pages which has sub directories… ABC and def. These sib directories ABC and def have its corresponding md files and slug a-b-c and d-e-f respectively.

I am trying to find the page ABC by doing page.find (’/xyx/a-b-c’) and trying to access the front matter of that page. But, somehow I don’t get that page.

Is there anything wrong that I am doing?

First can you reach them via your browser? That is a good way to ensure the route is correct.

Second, are these pages published ? If you for some reason set them to unpublished or if you set the date in the future, they will not be found.

Other than that seems like it should work as you have described.

Hello, thanks for the reply. I am indeed able to reach the route via the browser, and I did verify that.

I have not explicitly set the published attribute either. I am using the latest grav 0.9.45.

Side note: my first blog posts with Grav took hours to get published.
I was only able to fix it when the Admin plugin was made available and I noticed that the default Server Time was PST (I think) which explained the discrepancy with my posts’ actual creation timestamp in my time zone.

@minu can you confirm what you get back from the fine with something like:

{{ dump(page.find('/xyz/a-b-c')) }}

Turn on the Grav debugger and look in the first messages panel. You should be able to expand the variable if it exists, or if it doesn’t find it, there will be a null printed.

Hi, I have fixed it now.
It was a page reference error that caused the problem. My bad!
@rhukster: Thanks for the pointer