How to extend the panel with a plug-in?

I am working on a simple plug-in that allows quicker navigation between the pages (in the panel).

See screenshot.



The plug-in adds a new drop-down menu to the navigation bar (temporarily placed in the upper-right-corner), which shows a jump-list of all available pages.

In the normal situation your route to another page was like this;

  1. Click on dashboard.
  2. Click on the page you want to edit.

Using my plug-in, this is reduced to only one click;

  1. Hover to the drop-down.
  2. Click on the page you want to edit.

This way you can quickly copy/paste (share) content from page to page, without having to click every time on the dashboard and returning to the main-panel-hub.

It works fine (styling and coding is in progress), but how do I hook this (as a plug-in) into the panel?

It this moment I simply created a file like /site/plugins/panel-jumper/panel-jumper.php and this file spits out (directly) all the required code.

Doing that, all the code is placed straight after the opening <body>-tag (see developers console / DOM structure in the screenshot).


There must be a more gentle way to hook this in the panel, 'aight :stuck_out_tongue: (also because it throws an error in the console).

In Kirby 2.1 the panel-jumper was even loaded twice in the header, but fortunately Kirby 2.2 already did solve this.