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

Cannot set an ID to blocks #17224

Closed
Tropicalista opened this issue Aug 27, 2019 · 2 comments
Closed

Cannot set an ID to blocks #17224

Tropicalista opened this issue Aug 27, 2019 · 2 comments
Labels
[Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.

Comments

@Tropicalista
Copy link

Describe the bug
In some cases is useful to add an ID to an element. This is impossible on gutenberg.
Some blocks doesn't have the possibility to edit html, others give the "unexpected or invalid content" if I try to add an id.

To reproduce
Steps to reproduce the behavior:

  1. Create a paragraph block
  2. Edit as html
  3. Add id="cta"
  4. See error unexpected or invalid content

Expected behavior
html id should be an option if I want to use an advanced editor.
Adding an id option in block panel advanced settings should be considered

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser chrome
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version 76.0.3809.132
@talldan talldan added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks and removed [Feature] Block API API that allows to express the block paradigm. labels Aug 28, 2019
@talldan
Copy link
Contributor

talldan commented Aug 28, 2019

Hi @Tropicalista Thanks for creating the issue.

html id should be an option if I want to use an advanced editor.

Do you mind providing some more information on why you need an id for this instead of a class name?

Both the Group Block (a new block available in the plugin and due to be released in WP 5.3) and the Heading Block support adding ids via the 'Anchor' setting in the Advanced section. The Group block can be used to wrap any other block(s), so that might solve your issue.

I would mention that this feature is really for adding links to sections of posts.

@Tropicalista
Copy link
Author

The use case is to create a scroll down to section menu.

I wasn't aware the group block have this feature. So this solves my problem.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants