Inherting custom types

I started working with Prismic a few days ago. The setup has been quite seamless so far, and I've had little to no issue integrating my own custom types and setting up the API with a NestJS (express) backend. I'm working on providing a few custom type fields for SEO purposes: things like description, title, image, etc. These fields are rendered to meta tags by the server. They are declared on my page custom type on a tab named Meta.

I want to use those same fields on a different custom type. Is there a way to inherit content types or their fields? I simply want to avoid having to add the fields on every custom type I create, so an option for a custom type to inherit fields from another would be helpful.

For example, could a new custom type - say landing - inherit the tab that declares the SEO fields from the page custom type? This would make it to where I don't have to maintain several fields that are essentially global to the application.

Any help or insights would be great since I'm new to Prismic.

Hello Marshal, welcome to the Community!

I can recommend you to create a Custom Tagging system.

That way, you can create a Custom type with the name 'Meta' with the fields that you mentioned earlier, like this:

{
  "Main": {},
  "meta": {
    "title": {
      "type": "StructuredText",
      "config": {
        "single": "heading1, heading2, heading3, heading4, heading5, heading6",
        "label": "title",
        "placeholder": "title"
      }
    },
    "description": {
      "type": "StructuredText",
      "config": {
        "multi": "paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, rtl",
        "label": "description",
        "placeholder": "description"
      }
    },
    "image": {
      "type": "Image",
      "config": {
        "constraint": {},
        "thumbnails": [],
        "label": "image"
      }
    }
  }
}

Then, add a Content relationship field in any other Custom types where you want to use this metadata.

This issue has been closed due to inactivity. Flag to reopen.