Hi, is there a way to show a draft page on the front-end (apart from the panel)?
You can achieve this case with custom route and ->childrenAndDrafts()
. You can check out below sample for blog
entries:
<?php
// site/config/config.php
'routes' => [
[
'pattern' => 'blog/(:any)',
'action' => function ($uid) {
if ($page = page('blog')?->childrenAndDrafts()->find($uid)) {
return $page;
}
$this->next();
}
]
];