Change Custom Type — 2022

I see a previous topic from years ago asking about to change Custom Types. The answer has links to articles that no longer resolve. Things have changed since years ago. On Prismic's modern stack I don't expect much has changed in the way of 'renaming' a Custom Type but let me explain what we have and what we want to do:

  • Created a Custom Type documentation_page
  • Created two pages with this documentation_page
  • Used it for linkResolver() to create pages based on documentation_page
  • Realized we wanted to call this components instead of documentation_page

Is there a way we can re-associate all of the documentation_pages with a new Custom Type called components? I know we can rename the Custom Type, but in code we're still looking for documentation_page which will cause confusion. I want to keep naming consistent. How can we make this happen?

Hey @frank.stallone, thanks for reaching out.

It isn't possible to associate an existing Custom Type to the documents of a new one. You will need to copy the content of the existing documents using the new Custom Type components and then gradually replace references to it in your code.

The documentation and articles have indeed changed over the years. I have updated the links in the thread to be more accurate.

1 Like