Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Page.find() vs pages.find()

Started by Norbert 4 years ago · 1 replies · 529 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 Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 90 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 449 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 43 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 123 3 months ago