Skip to content

Add block_name and block_anchor fields to all blocks - #6

Open
dmitrijsmihailovs wants to merge 4 commits into
mainfrom
feature/block-settings-fields
Open

dmitrijsmihailovs wants to merge 4 commits into
mainfrom
feature/block-settings-fields

Conversation

@dmitrijsmihailovs

Copy link
Copy Markdown
Collaborator

Every constructor block now gets a collapsible 'Block settings' section with a block_name and block_anchor field, injected centrally in the Constructor component so no per-block or stub changes are required.

  • block_name is used as the block's builder label, falling back to the block title() when empty
  • block_anchor is live-slugified, dehydrated to a slug (empty -> null), and validated as a slug
  • both values persist in the block data and are available in views as $block_name / $block_anchor
  • labels are package-owned translations (filament-constructor::block-settings.*) registered via hasTranslations() and publishable

Every constructor block now gets a collapsible 'Block settings' section
with a block_name and block_anchor field, injected centrally in the
Constructor component so no per-block or stub changes are required.

- block_name is used as the block's builder label, falling back to the
  block title() when empty
- block_anchor is live-slugified, dehydrated to a slug (empty -> null),
  and validated as a slug
- both values persist in the block data and are available in views as
  $block_name / $block_anchor
- labels are package-owned translations (filament-constructor::block-settings.*)
  registered via hasTranslations() and publishable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant