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

Allow blocks to render semantic tags for full-site editing #20200

Closed
kjellr opened this issue Feb 12, 2020 · 5 comments · Fixed by #20218
Closed

Allow blocks to render semantic tags for full-site editing #20200

kjellr opened this issue Feb 12, 2020 · 5 comments · Fixed by #20218
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@kjellr
Copy link
Contributor

kjellr commented Feb 12, 2020

As we've been working through themes in the theme-experiments repository, a few of us have quickly run into the fact that Gutenberg currently can't render semantic tags like <header>, <section>, <aside>, and <footer>.

Functionally, these would probably just be Group blocks but with different markup: they're just a place to put other blocks. So perhaps this would be some sort of option for that block, only available in full-site editing? Or maybe there's some way we can automate this to avoid confusion for users?

@kjellr kjellr added [Type] Enhancement A suggestion for improvement. [Feature] Full Site Editing [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Feb 12, 2020
@mtias
Copy link
Member

mtias commented Feb 13, 2020

I have a few thoughts on this:

  • We should allow an htmlTag attribute on the group block.
  • Doesn't need to be exposed in the UI yet, but could be added to the Advanced tab in the inspector.

It'd be interesting to then register variations of the group block for <header>, <section>, <main>, <aside>, and <footer>. (cc @gziolo)

@chrisvanpatten
Copy link
Contributor

I also wonder if @ellatrix's PR #19910 could contribute to solving this?

@gziolo
Copy link
Member

gziolo commented Feb 13, 2020

I opened PR with proof of concept for Section variation for the Group block. Feel free to play and adjust #20218 if necessary 😄

@carolinan
Copy link
Contributor

It also raises question marks about how to prevent users from altering the tags and creating a mess for accessibility (and SEO).

@mtias
Copy link
Member

mtias commented Feb 18, 2020

An initial version shouldn't expose this in the UI, I recon. Whenever it becomes a user-facing feature of the group block, it should come with the corresponding analysis of content structure to indicate problems or help educate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants