I’m wondering if there is a more convenient way, to add the same new field to all existing blocks. The background is: I need to provide a flag for each block, that the user can toggle on or off.
So I was trying to extend the fieldsets list like this (here as an example with the heading block):
fields:
pagecontent:
label: Seiteninhalt
type: layout
fieldsets:
- type: heading
extends: blocks/heading
fields:
flagged:
label: Markiert
type: toggle
- text
- list
- quote
- image
- button
- line
- gallery
- table
- video
- code
- markdown
Which gives the desired result in the panel:
Now I want this field to be available for text, list, quote, etc. too. So my two questions are:
- Is there a better way to add the same field to all blocks, like adding it to a “parent block object” or something?
- Is there a way to style all flagged=true blocks in the panel with CSS without touching the panel templates of each block?
Thanks in advance!
