Call to a member function title() on boolean error

Hi Good day! I am now currently connecting a template to kirby and making it dynamic. At first I thought codekit caused the error but when I tried testing it on my old kirby installation, the error also existed there. Below is a screenshot of the error. Is there something wrong with my syntax? Any help is appreciated. Thank you! :slight_smile:

Yes, there is definitely an error.

$page->find('home')

does not make sense.

You can use either:

$pages->find('home')->title()
page('home')->title()

And usually, it should be possible to just use

$page->title()

don’t know why you are trying to find the page first, unless your home.php template is not for the home page.

Cause of the error: The page object does not exist, and you can’t call an object’s method on a non-existing object.

1 Like

Thank you @texnixe the $page->title() works. I should’ve study more! Thanks a lots!