I’m trying to write a plugin that allows panel users to fill multiple pages fields visually from a big collection of items. Ideally this would be a drag&drop gesture. I already made some progress by writing my own pages_section
that looks and feels like the Kirby original. It corresponds with a custom pages_field
that accepts items dragged from the section.
The key for what I’m trying to do is to set the group
attribute on the vue-draggable components. I configure the pages section to clone the dragged item, rather than moving it over.
// in my CustomPagesSection.vue
<draggable ... :group="{ name: 'people', pull: 'clone', put: false }">
// in my CustomPagesField.vue
<draggable group="people" @change="saveField">
This is somehow working for me. The CustomPagesField.vue can then save when the item was dropped.
I’m using a lot of copy&paste code to replicate the look and feel of the Kirby section and field. I’d like to reuse and extend more of what’s already there, but I can’t get it working.
k-collection, k-draggable, k-item seem to be the ingredients but I’m struggeling at the very beginning: how to extend k-draggable to feature a group
attribute?
Hope somebody can point me to the right direction.
Thank you & Hi!
Hans