Panel sidebar page widgets in the blueprint. THE solution?

Panel sidebar widgets has been discussed before but there has been no clear solution to how it should be done. Here is an idea of how…

Blueprint

title: Projects
fields:
  title:
    label: Title
    type: text
widgets
  page_settings:
    label: Page settings
    type: page_settings
  my_custom_widget:
    label: My custom widget
    type: my_custom_widget
  pages:
    label: Pages
    type: pages
  files:
    label: Files
    type: files
  • page_settings, pages and files are Kirby built in widgets.
  • my_custom_widget is my own widget that I’ve placed between them.

Fallback

If widgets does not exists in the blueprint, fallback to the built in page widgets. It makes it a non breaking feature.

If labels are not added to built in page widgets, use the built in ones.

To register the widget it could be done kind of like this:

$kirby->set('page::widget', 'my_custom_widget', __DIR__ . '/page-widgets/my_custom_widget');

I’m not sure about the name but see it as an idea.

Why blueprint for page widgets

  • The panel page uses a blueprint for all the fields so why not for page widgets as well.
  • Sorting is a breeze within a blueprint (move text around).
  • The blueprint already exists so there is no need to invent something new.
  • When using the same blueprint file for the fields and page widgets, everything in that panel page is controlled by this blueprint.
  • Probably easy for the crew to build as most of the work is already done, with blueprint parsing ect.
  • It’s a non breaking feature. If the blueprint is used for older Kirby versions it will just ignore the widgets part.
  • If I remember correctly blueprints have support for multiple languages as well?

Isn’t this THE perfect solution to the problem? It feels like I nailed it! :smiley:

7 Likes

Jens, I think you actually really nailed it. This is bloody brilliant. I will need to think about it a bit more, but it actually solves quite a lot of issues. I’m also not entirely sure about the naming, but that’s really just a small detail. @lukasbestle and @texnixe should also have a look at it.

4 Likes

I would really love this feature!
Is this still being developed?

Kirby 3 will come with a different philosophy that will make this superfluous. If you are curious:

https://getkirby.com/next

Ah cool!

What’s the timeline for the new release?
Months or years?

@Willem: Kirby 3.0, any release date?

There’s already quite some stuff to play with for K-Next supporters…