Contentful logo

Contentful Community

Nested content duplication

I have a content type with a reference field to another type, which in turn has references to other types. When i duplicate the “base” type it creates a copy of it but not of the references. Is there a way to make this duplication “deep” and force it to also duplicate it’s references recursively?

Hi @joakim.millen

What you are describing is not possible with our Web App. However, there could be a few way you could try to solve it

  • Build a UI extension for the sidebar that has the function to duplicate the entry. The UI extension leverages on the Management API, therefore you could make it duplicate also the linked entries.
  • Similarly, you could write a script using one of our SDKs for the Management API that given a specific entry ID duplicates the entry and the linked entries recursively.

Thanks for the reply @Alma

Is there a way to use custom apps to hook in to the native duplication functionality? Because using a custom sidebar solution would work fine if not for the fact that editors would probably still just mark items in the list and click “duplicate” since thats the usual way to do it and we can’t make sure that they wont do it way if we can’t hook into that native functionality

Hi @joakim.millen,

I’m not sure what you mean by ‘native duplication’, since as I stated before, it’s not something that Contentful supports out-of-the-box. You could try to build an App, or a UI extension, but this will still require a certain ‘procedure’ from your Editors, to know exactly what they are doing.