Anybody an idea how I can find a page object and then pass it as a page reference field, tried several things but it’s not working out atm
The endgoal is that I want to find the page object for ‘jobs’ and then pass it with a block that uses it to link to that specific page.
$jobsPage = site()->find('jobs');
// var_dump($jobsPage);
// die();
$block = \Page::factory([
'slug' => 'virtualWorkWithUs',
'template' => 'block-center',
'content' => [
'showLogo' => true,
'blockBgcolor' => $bgcolor,
'blockPreTitle' => __('Join our team'),
'blockTitle' => __('Werken bij Studiebureau Rimanque?'),
'blockText' => __('text'),
'buttonToggle' => true,
'buttonLinkToggle' => true,
'buttonText' => 'Join our team',
'buttonLinkPage' => $jobsPage,
],
]);
return snippet('blocks/block-center', compact('block'));