Reuse kirby fields in one blueprint

Hey,

I want to reuse some fields (i.e. a cta blueprint) for multiple tabs on the same page (i.e. home blueprint).

If I create the following blueprint, I will receive an error for saving the data or if I delete the content page and create it new - it shows The field **"cta_heading"** already exists in your blueprint.
I sthere a way to “modify” or “prefix” the blueprint “module” so I can reuse the parts?

This is the home.yml snippet:

  values:
    label: Values
    fields:
      values_heading:
        type: text
      values_teaser:
        type: text
      values_text:
        type: textarea
      values_array:
        type: structure
        fields:
          values_entity: fields/values_entity
      values_cta: fields/general_cta
  services:
    label: Services
    fields:
      services_heading:
        type: text
      services_teaser:
        type: text
      services_text:
        type: textarea
      services_array:
        type: structure
        fields:
          services_entity: fields/services_entity
      service_cta: fields/general_cta

Both tabs are using the “general_cta” blueprint snippet.

general_cta.yml:

type: group
label: CTA object
fields:
  cta_heading:
    type: text
  cta_text:
    type: textarea
  cta_colored:
    type: toggle
  cta_buttons:
    type: structure
    fields:
      cta_button_text:
        type: text
      cta_button_link:
        type: link
      cta_button_type:
        type: select
        options:
          primary: Primary
          secondary: Secondary

Since I need the CTA Part 5 times on the page and on others I would love to use the snippet instead of using multiple times the exact same code.

Thanks for the help :slight_smile:

Field groups cannot be reused

Is it possible to implement my use case using the blueprints?

Can the complete field group be wrapped inside an object field, maybe? Anything else won’t work because field names need to be unique.

The only alternative would be to use subpages instead of tabs…

Or you could use a PHP blueprint and prefix the field keys.

If all that is faster or cleaner than just copying the fields into your blueprint?