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

Group Block - custom markup filtering option #15000

Closed
paulkirspuu opened this issue Apr 16, 2019 · 10 comments
Closed

Group Block - custom markup filtering option #15000

paulkirspuu opened this issue Apr 16, 2019 · 10 comments
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Enhancement A suggestion for improvement.

Comments

@paulkirspuu
Copy link

paulkirspuu commented Apr 16, 2019

Suggestion for improvement regarding the Group block:

  • custom markup filtering option (to change <div> -> <section>, add a wrap element between Group block and content, and etc.)

Your thoughts, please.

@paulkirspuu paulkirspuu changed the title Group Block - custom markup filtering & clear distinction in admin Group Block - custom markup filtering option Apr 16, 2019
@lkraav
Copy link

lkraav commented Apr 16, 2019

Isn't there a generic block markup filtering chain in place already @paulkirspuu have you researched?

@Soean Soean added [Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Enhancement A suggestion for improvement. labels Apr 16, 2019
@paulkirspuu
Copy link
Author

Isn't there a generic block markup filtering chain in place already @paulkirspuu have you researched?

I have, didn't find a filtering option unfortunately.

@lkraav
Copy link

lkraav commented Apr 18, 2019

@paulkirspuu ping Slack #core-editor perhaps, as well.

@erikjoling
Copy link

About the wrapper between the group block and the content: issue #15042 goes deeper into that

@erikjoling
Copy link

The section block of the Ultimate Addons for Gutenberg plugin offers the possibility to switch the html-tag:

image

https://github.com/brainstormforce/ultimate-addons-for-gutenberg/tree/master/src/blocks/section

@swissspidy
Copy link
Member

In the meantime, the blocks.getSaveElement filter can be used to change the HTML tags.

I don't think giving everyday users an option to change the HTML tag makes sense. They would not know what to do with that.

@lkraav
Copy link

lkraav commented May 3, 2019

Tyvm. @paulkirspuu lmk what you can do w/ this filter.

@strarsis
Copy link
Contributor

But this means when a theme is switched, all pages have to be opened in page editor and re-saved so the blocks.getSaveElement filter can update the markup? Wouldn't it be better to have an intermediate layer that can change the markup on editor page and frontend, without affecting the stored editor content?

@carolinan
Copy link
Contributor

@paulkirspuu
Hi!
The group block has an HTML Element filter in the Advanced section.
This was added in #28576
Can this issue be closed?

@lkraav
Copy link

lkraav commented Sep 29, 2021

Can this issue be closed?

We ended up using stock Group block markup in editor and we filter its output at PHP level via add_filter render_block_data.

Other options mentioned above also help people for alternatives.

This issue is solved.

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) [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

7 participants