Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Page.find() vs pages.find()

Started by Norbert 4 years ago · 1 replies · 894 views
4 years ago

I am using the code in the template files (.html.twig): page.find (), e.g.
{% set page = page.find ('/_widgets/_about') %}

Everything seemed fine, but I noticed on the 404 error page that the page object is null.

So I changed the code from page.find() to pages.find() and everything started working on both the normal pages and the 404 error page.

So what's the difference between page.find() and pages.find()?

In the documentation, there are both versions in the sample codes.

4 years ago

Can you provide the documentation link about page or pages ? i just curious ..

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by MarkP, 7 days ago
3 123 3 days ago
Themes & Styling · by TomW, 6 days ago
0 65 6 days ago
Themes & Styling · by themetman, 2 weeks ago
1 159 2 weeks ago
Themes & Styling · by AH, 4 weeks ago
1 274 2 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1461 2 weeks ago