How to extend the panel topbar menu with custom entries / links?

Hi,

I would like to extend the panel topbar menu from within a Kirby Plugin without having to manipulate the original panel files. Is this possible? The goal is to simply append a new item (with an icon) and link it to a special panel subpage for the client. I don’t want to make a whole widget for this just for putting a link inside of it.

After hours of research I couldn’t find anything similar both in the Kirby docs and other sources… :confused: Does somebody had the same problem too and found a solution?

Thank you in advance!
Foddy

No, that’s not possible. Those plugins that add a new page to the Panel are all using a widget to access the page.

Oh yes thanks, that is true.

I am making a plugin which contains the widget and declare it with the registry functions to be loaded up on the panel backend. Just like on kirby-logger. Kirby logger also extended the topbar to create a new panel page with the logs table inside and extended the breadcrumb menu.

I thought if this is possible it must be also a way to solve my “problem” – so this is also not possible from within a widget to append a new menu item?

Best
Foddy

Yes, the page appears in the breadcrumb but there is no way of adding the page to the menu without messing with the core files.

hmm too bad… But thanks anyway!
Any plans to officially support this feature on some future Kirby versions?

It would be awesome!

Well, I am in no position to promise anything, but I guess this will be possible in future versions.

The breadcrumb is added via the topbar function:

  public function topbar($topbar) {
    $topbar->append(purl('logger'), 'Logger');
  }

in logger/mvc/model.php

1 Like

Just figured out that you are the developer of the plugin! :smiley:
Awesome! Thanks!

Related: https://github.com/getkirby/panel/issues/826