maybe there is a stupid mistake in my code but I cannot get that to work. i want to get all pages with the same title as the current page and get their url. my code is as follows:
<?php
if ($pages = page('home')->children()->children()->findBy('title', $page->title())) :
foreach($pages as $page):
<a href="<?= $page->url() ?>">link</a>
endforeach;
endif;
?>
but i get following error:
Call to a member function url() on null
does anybody see my mistake or point me in the right direction for my problem? any help is much appreciated!