The idea is to set page as Home page simply by dragging it to the top of the list in the panel.
So in home.php I have:
<?= $pages->template('default')->first()-> ... ?>
I cannot find the way to render a page. How can I achieve it?
The idea is to set page as Home page simply by dragging it to the top of the list in the panel.
So in home.php I have:
<?= $pages->template('default')->first()-> ... ?>
I cannot find the way to render a page. How can I achieve it?
You can set a custom page as home like that:
return [
'home' => 'blog'
];
The first page does not mean home.
I’d use a route that renders the chosen page:
'routes' => [
[
'pattern' => '/',
'action' => function() {
if ( $page = 'define which page here') {
return $page->render();
}
$this->next();
]
]
… or add a field in the home.yml to select that page and in the template home.php “go” to that page.