Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move sets between sets #748

Open
edalzell opened this issue Feb 8, 2022 · 3 comments · May be fixed by statamic/cms#10359
Open

Move sets between sets #748

edalzell opened this issue Feb 8, 2022 · 3 comments · May be fixed by statamic/cms#10359

Comments

@edalzell
Copy link

edalzell commented Feb 8, 2022

We have a heavily nested page builder (replicator/bard inception).

"Ability to move a block to another nested area (i.e. Let's say I nested a bunch of grid_1 but then decided to start another Grid block someone else on the page and want to move one of the grid_1 to the new location) *I encounter this so often and this is a huge time waster to remake a block"

Would be great if we could copy/move our block between sets.

@jacksleight
Copy link

jacksleight commented Feb 24, 2023

Following a conversation on Discord I had a play around with copying sets between replicators. Got the basics working but then ran into a fun(?) problem:

How do you check whether a set is valid for the target replicator? Ideas so far:

  1. Check that the source and target field paths (excluding numerical indexes) match. This would allow copying between pages and parent sets, but prevent copying to differently named fields that use the same config.
  2. Check that the set handle exists in the target’s set list. Would work if people are careful with their set handles, but they don’t have to be unique across replicators so there’s a chance they could conflict.
  3. Do some sort of hashing of the set configs and use those to check that the target contains a matching config. Assuming this is actually possible it might be the most robust, but it’s also the most complicated.
  4. Do nothing and let people get invalid set errors, and possibly invalid values. This is already possible in Bard and it doesn’t appear to have come up as an issue. 🤷‍♂️

Be interested if anyone has any thoughts on this?

It’s a feature I’d love to have and I’d be happy to work on a PR for it, but I’m a bit stumped right now.

@K3CK
Copy link

K3CK commented Feb 24, 2023

I think I'd go with number 1 for a start, if I understood it correctly (not 100% sure what you mean with "prevent copying to differently named fields that use the same config").

For me the most common use case is that I have a replicator with a number of sets that I use on different pages. Sometimes I then want to copy a built out set from page A and paste it to the same replicator field on page B.

For what I understand this would be possible with your suggestion number 1. The replicators' handles have to match to be able to copy/paste between them.

If this means I can't copy/paste between replicators with different handles but shared sets, I'd be fine with that. I think that's a not so common use case and could maybe tackled later.

@StudioNautilus
Copy link

Samesies on this one! While the editing experience of statamic is amazing, this turns out to be a bit of a bottleneck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants