Getting the "open site" preview working in a one-pager

Hello there,

i have build a one-pager and have a question regarding the preview option:

The preview option in the panel will render the preview using the default template for example like this: root/mysite/some-sub-site
But because I have build an one-page layout i just have a ‘home.php’ template and the ‘default.php’. Everything else is build using snippets. If I want to preview my written content the panel will send me on a page, rendered by the ‘default.php’ template and thus the preview is incorrect.

What is the proper way to get the preview feature to work for a one-pager?

Thank you

I think the best option is to reroute the default template to the home page. That is advisable anyway so that people cannot load the page when accessing the url directly.

//default.php template
<?php go('home') ?>

If your sections are subpages of the home page, you can also use the blueprint preview setting: https://getkirby.com/docs/panel/blueprints/page-settings#page-preview

okay that helped.

Thanks for helping me out :slight_smile: