I’m trying to create a Kirby plugin that would extend the functionality of the Panel, especially editing of pages.
However I’m stuck trying to find the best and cleanest approach without hacking around too much unnecessarily. I am considering
Essentially what I need is:
identifying pages edit requests (so far using the path object)
access the pages edit form (I need to add an extra button per page edit, next to Save)
pick up requests made to a specific route on the panel
Currently, in my plugin I’m filtering panel requests only via
if (! function_exists('panel')) return;
I’m now stuck with the panel() object, but a lot of the properties there are inaccessible, like path for example (var_dump(panel()->path shows NULL). Although I can workaround that using the kirby() object, it feels like hackish already.
I’m also starting to wonder if it is at all possible to “plugin” into the forms, at least without having to hack the panel source.
I’ve read through them, and it seems nothing would help much with what we need. Perhaps you could have a better idea of how to use any of them for our needs. What we’re aiming at building is essentially a review mechanism for page edits. To spare you all the details of how we’re using Kirby, technically the result should be:
a special content/filestates.txt file that contains states for every file (example file: content/2-pets/cats/cat.en.txt)
This special file would look something like this: