How to extend a block?

I created a new blueprint called “heading.yml” in “site>blueprints>blocks” containing the content as described here: Modifying blocks types and custom blocks | Kirby CMS

fields:
  blocks:
    type: blocks
    fieldsets:
      heading:
        extends: blocks/heading
        fields:
          customId:
            label: Custom ID
            type: text

It does not work, its resulting in breaking the block editor. Am i missing sth. to make this work?

Would it be an idea to extend the recipe to contain a more detailed instruction on how the structure of the block-blueprint should look like?

The example you linked to is for extending a block on the fly in the blueprint where the field is used. For a separate block blueprint, see the original ones which you can find here:

Heading in particular: heading | Kirby CMS

Thanks for clarification. I think i have to refine my question: I am using the layout-field. The layout field contains different blocks to be used. I want to extend / change the blocks used in the layout field. Is it possible to extend / change the blocks showing in the layout-field?

Two things i want to archive:

  • i want to extend the “Headline”-Block to be extended by an id.
  • i want to define the “uploads”-parent for the “Image”-block.

You can do it in two ways:

  • you either create a new heading/image block (i.e. with different names) in the /site/blueprints/blocks` folder and then use the new block names in your layout field
  • you make the changes on the fly in your page blueprint (or whereever you are using the layout field:
fields:
  label: Text
  type: layout
  fieldsets:
    heading:
      extends: blocks/heading
      fields:
        customId:
          label: Custom ID
          type: text
      #…