Panel Configuration

Configure preview URLs and Panel redirects for headless setups.

Frontend Preview URLs

In headless setups, Panel preview links point to the backend by default. Use the frontendUrl page method to redirect preview links to your frontend application.

Blueprint Configuration

Set the preview option in your blueprint to use the frontendUrl method:

site/blueprints/pages/default.yml
options:
  preview: "{{ page.frontendUrl }}"

For the site blueprint, use site.frontendUrl:

site/blueprints/site.yml
options:
  preview: "{{ site.frontendUrl }}"

Config Setup

Configure your frontend URL in config.php:

config.php
return [
    'headless' => [
        'panel' => [
            'frontendUrl' => 'https://example.com'
        ]
    ]
];
If frontendUrl is empty, the preview button will be disabled.

Panel Redirect

For headless-only projects, automatically redirect visitors to the Panel when they access your backend URL. This is useful when your Kirby installation serves no frontend content.

config.php
return [
    'headless' => [
        'panel' => [
            'redirect' => true
        ]
    ]
];

When enabled, unauthenticated requests without a bearer token will redirect to the Panel login page.