spicywebau / craft-batch-actions

A Craft CMS plugin for performing batch actions on Matrix and Neo blocks
MIT License
4 stars 3 forks source link

Add copy/paste/clone buttons #1

Closed ttempleton closed 1 year ago

ttempleton commented 2 years ago

It might be good to add buttons for copying/pasting/cloning all selected blocks. For Neo fields, this can use Neo's inbuilt copying/pasting/cloning functionality, while support for Matrix fields would likely involve integration with Smith.

ttempleton commented 1 year ago

Batch Actions 1.2.0 has just been released with the copy/paste buttons - for Neo, this requires Neo 3.4.0+, and for Matrix, this requires Smith to also be installed.

A clone button hasn't been included, because it seemed unlikely to be that useful when I rethought it, and I thought that using the copy/paste buttons would suffice if anyone did want to clone all blocks. If anyone who sees this disagrees, please feel free to open a new feature request for it 🙂

ccchapman commented 1 year ago

Thanks for this! It's working here.

The only thing I noticed is that the "Paste" option doesn't respect Neo block limits. e.g. If Neo field supports only 1 top level block, you can Paste as many as you'd like. Back-end validation kicks in though so it's not a huge issue. I don't know if it matters much but sharing in case it's trivial.

ttempleton commented 1 year ago

Thanks for sharing that @ccchapman - should be fixed now in 1.2.2.