sanity
sanity copied to clipboard
Enable copy/paste of object/array data in Studio
Is your feature request related to a problem? Please describe.
There's currently no way to copy data structures from object and array fields between documents or fields of a document. This would also include reference fields.
Describe the solution you'd like
It would be interesting to have this feature (as a configurable field option) so it would show as an icon to the side of such field, for example the three-dotted 'more' icon. A menu would allow copy, and once copied, fields would enable the paste option in that menu as well.
I addition, even though we can duplicate a document, having copy/paste functionality on the document level would also be useful. I can also see this being tied into the 'Inspect' panel, allowing JSON to be copied/pasted there and edited manually. This should also be configurable in the schema.
+1
This is something my clients asked several times and It also would help me personally while developing.
@fabien I guess this issue should ask for a "Multi-Document" copy-paste feature.
Example: Copy an entire object
or array
or array item
to another document.
+1
Our clients are also asking for this.
+1 This would be of great help!
+1 This is a feature I'm missing when I am filling in content in sanity
+1 Boss has wanted this for a while.
+1 This would save so much time!
+1 This is definitely a must-have for content creators!
+1
Use case: structuring website with modules grouped into sections. This is possible right now, but if an editor decides they want to change a module to a different section, they have to recreate the module in the other section manually. This feature would allow just copying/cutting the module from the array in the old section to the array in the new section.
To simplify, I would suggest only allow copy/pasting between arrays with the exact same schema (works for my use case, not sure about others).
+1 My use case is similar to @fvieira It would be amazing to have this feature since manually recreating a module in another document is tedious sometimes, allowing object/array paste would make this process a lot smoother.
Definitely a necessity!
Clients ask about this first thing: "Yeah, but how do I copy these like in other CMS's?"
It's definitely a fundamental feature would help both editors and developers save tons of time.
+1 for being able to paste in the JSON for the document database. If the field is not known to the schema, then that's on the user. The studio already handles when a field on the data is unknown to the schema.
Basically 'replace' the 'raw JSON' content, if I'm understanding this. That's what I'd like to do too.
We have built a small POC and might extend it over the coming weeks:
https://github.com/sanity-io/sanity/assets/45669613/6372596b-e917-4266-88d2-712546b4b8cf
This is only a small proof of concept and would need to be adapted to various cases like images and references. It's likely also reasonable to first limit this to arrays of the same type.
In case you are interested to build something yourself, you can have a look at the code here:
https://github.com/KasayoDotCom/sanity-copypaste-poc
Hey everyone! At the end of April, we at @superside-oss built a full-functioning plugin for Sanity Studio, which covers this case.
You can install it from here: https://www.sanity.io/plugins/copy-paste
@Hahlh we'd love to see you as a contributor to our repo: https://github.com/superside-oss/sanity-copy-paste!