• Resolved JĂĽrgen

    (@trimension)


    I recently started developing my own Gutenberg blocks. I stumble across endless problems… many things are not fully developed, many things only work to a limited extent and for other things such as borders there are numerous solutions, but they all work completely differently and not in every environment… what makes it even more difficult is that The concepts change with each version, so most tutorials are already outdated by the time they appear…

    I have the impression that the whole thing was knitted with a very “hot needle”. Unfortunately the documentation is very superficial and incomplete… it’s really exasperating…

    There doesn’t seem to be a Gutenberg development support forum… Where can I ask specific questions about block development? Where can I get actual Information and Help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The first and best site for information is the handbook: https://developer.www.ads-software.com/block-editor/

    If you have found feature requests or bugs, you can submit them to the Gutenberg team: https://github.com/WordPress/gutenberg/issues

    If you have specific questions, feel free to ask them here.

    Tip: I have found it useful to look at how others have written their blocks.

    Thread Starter JĂĽrgen

    (@trimension)

    Hi there… and thank you very much for the information… I know the block editor manual… it is very helpful, but unfortunately also very, very superficial.

    The problem is that there is no description anywhere on how to do certain things… e.g. I want to be able to put a border on my block… how do I do that?

    I’ve found “experimental” block support features that work quite well, but there’s also a BorderControl component and a BorderBoxControl component… what are they for? And I had to laboriously find out that there is a theme support “border” that has to be active for this to work… at least that’s not described anywhere

    I have to laboriously find a lot of things on Github by analyzing the code of the core blocks…

    You would have to specify this more precisely:

    I want to be able to put a border on my block

    Do you want the user to be able to put a border on your block or do you want to specify a border that cannot be changed? Both require different ways of solving the problem, which is why you have to define it more precisely.

    Thread Starter JĂĽrgen

    (@trimension)

    you’re right, sorry… I was a little frustrated after two weeks evaluating.

    Finally I found a solution and immediately ran into the next problem.

    The idea was to allow the user to set a border for the block using the sidebar control (color, style, thickness, radius). The currently experimental block support works and does what I expect. The same applies to setting padding and margin-spacings…

    "supports": {
    		"align": true,
    		"anchor": true,
    
    		...
    
    		"spacing": {
    			"margin": true,
    			"padding": true,
    		},
    		"__experimentalBorder": {
    			"radius": true,
    			"color": true,
    			"width": true,
    			"style": true,
    		}
    	},
    
    ...
    
    	const borderProps = useBorderProps(attributes);
    
    	const spacingProps = useSpacingProps(attributes);
    

    But this doesn’t seem to work in every theme. I use the Neve theme in the purchased version, where the corresponding controls are simply missing from my blocks, and I found, that this is not a problem of my blocks… All Core-Blocks does not have the Border- and Spacing-Controls with Neve activated.

    So I found out that some theme support settings are necessary to activate these controls…

    add_theme_support('appearance-tools');
    add_theme_support('border');
    add_theme_support('custom-spacing');

    So I created a child theme to set these theme supports, which actually helped. The controls are now available on all blocks using these settings. I’m currently checking with the theme manufacturer to see whether this could cause conflicts with the original theme.

    The Neve-Theme (from Themeisle) is still a classic-theme without theme.json… Therefore, I could of course also store a theme.json in my child theme… but I have no idea what effects that will have on the theme and my site (side effects, etc…)

    But unfortunately there is still another problem with the theme_settings, because with the “custom-spacings” I only get the padding settings. The margin settings are still missing

    • This reply was modified 1 year, 1 month ago by JĂĽrgen.

    According to https://github.com/WordPress/gutenberg/issues/51701, only padding can be activated for classic themes without theme.json. If you want to change this, I would recommend that you submit this as a feature request to the Gutenberg team.

    Thread Starter JĂĽrgen

    (@trimension)

    Thank you very much… that explains everything… I can’t see any logic behind hiding the controls, but at least now I know that I have correctly understood what works and what doesn’t work ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Gutenberg Development – Need Help’ is closed to new replies.