Could not find Panel view for route: pages

Hi,

After reading the docs (at: panel.menu | Kirby CMS) I thought to quickly add a menu entry in the panel left-side menu “Pages”, listing all my pages. But I get this error: Could not find Panel view for route: pages

Anybody?

Thanks in advance.

            'pages' => [
                'icon'  => 'page',
                'label' => 'Pagina\'s',
                'current' => function () {
                    $path = kirby()->request()->path();
                    return $path->first() === 'pages' && $path->nth(1) !== 'themas';
                }
            ],

Would be good to see the context around the code you shared to see if it’s being used correctly in the config.

I don’t think that’s necessarily the issue related to the error message you get but currently your menu entry is also missing either a link, dialog or drawer. It’s not quite clear what it should do when clicked.

Sorry, you’re right, here is my complete config, the objective is to show a list of all my pages by clicking the “Pagina’s” (top) menu item in the main menu.

<?php
// site/config/config.php

use Kirby\Toolkit\Str;
use Kirby\Cms\Page;

return [

    'panel' => [
        'menu' => [
            'pages' => [
                'icon'  => 'page',
                'label' => 'Pagina\'s',
                'current' => function () {
                    $path = kirby()->request()->path();
                    return $path->first() === 'pages' && $path->nth(1) !== 'themas';
                }
            ],
            'site' => [
                'icon'  => 'settings',
                'label' => 'Site Instellingen',
                'current' => function () {
                    return kirby()->request()->path()->first() === 'site';
                }
            ],
            'themas' => [
                'icon'  => 'palette',
                'label' => 'Thema Beheer',
                'link'  => 'pages/themas',
                'current' => function () {
                    $path = kirby()->request()->path();
                    return Str::startsWith($path->toString(), 'pages/themas');
                }
            ],
            '-', // Standaard separator in jouw config
            'users' => [
                'icon' => 'users',
                'label' => 'Gebruikers',
                 'current' => function () {
                    return kirby()->request()->path()->first() === 'users';
                }
            ],
            'system' => [
                'icon' => 'cog',
                'label' => 'Systeem',
                'current' => function () {
                    return kirby()->request()->path()->first() === 'system';
                }
            ]
        ]
    ],
    'debug'  => true,
];

Have you tried adding an actual link to that menu entry? Right now it’s neither setting a link or a dialog/drawer route, so it’s not clear what should/could happen when the menu entry is clicked.

yep I tried that like this:

    'panel' => [
        'menu' => [
            'pages' => [
                'icon'  => 'page',
                'label' => 'Pagina\'s',
                'link'  => 'pages',
                'current' => function () {
                    $path = kirby()->request()->path();
                    return $path->first() === 'pages' && $path->nth(1) !== 'themas';
                }
            ],

This doesn’t work and throws the error: Could not find Panel view for route: pages

However if I replace the link with an existing (sub)page within pages, this page is retreived and visible… like:

 'link'  => 'pages\themas',

Right, you need a link to an existing page here, you cannot show a “list of all pages”, unless the page you link to contains that list, usually, the site entry takes care of linking to a list of all relevant pages, or you would have to create a custom area.

Thanks for that texnixe, meaning there is no such internal Kirby route: /panel/pages that’s what I made up (:- (with the help of AI gemini 2.5) and got me confused.

If we want a list of pages we use: /panel/site or we create a specific list page?

Thanks both of you for taking time to clarify

Right, either use the site, a specific “container” page (e.g. with a single section that lists all pages as a flat list) or a custom panel view.