Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Anchors for Pattern Overrides #64414

Open
2 tasks done
asafm7 opened this issue Aug 10, 2024 · 1 comment
Open
2 tasks done

HTML Anchors for Pattern Overrides #64414

asafm7 opened this issue Aug 10, 2024 · 1 comment
Labels
[Feature] Block bindings [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@asafm7
Copy link

asafm7 commented Aug 10, 2024

Description

HTML Anchor attribute setting is available on a global level for an overridden block.

This makes the HTML invalid (as the ID should be unique) and impossible to use HTML Anchors inside patterns.

Step-by-step reproduction instructions

  1. A synced pattern with an overridden heading.
  2. There is no way to create a unique ID for each heading, for in-page navigation.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@asafm7 asafm7 added the [Type] Bug An existing feature does not function as intended label Aug 10, 2024
@t-hamano t-hamano added the [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced label Aug 11, 2024
@talldan talldan changed the title HTML Anchors for Overridden Blocks HTML Anchors for Pattern Overrides Aug 13, 2024
@talldan
Copy link
Contributor

talldan commented Aug 13, 2024

Thanks for reporting this. I think this is an existing issue for patterns, even before overrides existed. Any heading (or other block that supports 'anchor') in a pattern would be duplicated, including the anchor, when that pattern is inserted twice in the same post. Users would probably solve this by detaching the pattern content and editing it.

Block bindings/pattern overrides supporting the anchor attribute is a good opportunity to solve this.

There would be some UI issues to solve as the anchor attribute is presented in the block inspector, and that's unavailable for overriden blocks in patterns (due to the contentOnly UI - see Advancing contentOnly editing).

cc @SantosGuillamot, this might be something to consider on the block bindings roadmap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block bindings [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants