-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Altering / Restricting core blocks for consistent design #7295
Comments
Hi @katerlouis - There have been a few issues about this topic. You might want to look at #6023, #5360, #3330, #6228, #5785, and the block extension documentation: https://wordpress.org/gutenberg/handbook/extensibility/extending-blocks/ Those issues and links will give you some context on what's possible now and what might be possible in the future. |
Shame on me– I already read the extensibility intro, but haven't gotten, and obviously totally forgotten about, the extending-blocks section in the handbook. Sorry for that! Great reading in these issues; but it's just too much. :( Since the Let's see how far I can go :) My biggest issue is finding reliable resources for all this new JS stuff. Anyhow, thank you very much! |
You can also just disable the custom colors and color palette. All these design options will be exposed to |
Hopefully this topic isn't discussed elsewhere already. I doubt it though.. but I couldn't find a designated thread for this; please forgive me!
As great as Gutenbergs flexibility and freedom for editors is, to me as a designer/developer it is just as important to restrict the editing experience, to achieve consistent design throughout the page.
For instance:
In my design, the the editor should only be able to choose between 2 paragraph classes/styles in the inspector. No background- or text-color, no additional classes.
Workaround
Just tell the customer to always use the custom paragraph block!
Possible solution 1: Overwriting the core block
A custom block with these requirements + unregister the core paragraph
Possible solution 2: Altering the core block
My mindset here is similar to how hooks/filters work.
You guys implement something like
changeBlockType()
, which the dev can use to setsupports: {}
andattributes: {}
as see fit.Possible solution 2b: You guys give a bunch of options
Similar, but different–
changeBlockSettings()
is a function, that gets an options-object, which the core-block reacts to on registering.When restriction won't be possible, I fear Gutenberg will do more harm than good to my websites. You can make detailed design-guides for editors all you want; in reality: if there are options, these options will be used.
Very interesting topic,
I am thrilled to learn how you guys suggest to proceed here.
The text was updated successfully, but these errors were encountered: