• Hi guys,

    I have noticed you are using a blockAlignment as an attribute name instead of WordPress’ default align name.

    1. Is there any specific reason for this?
    2. Do you use align attribute name for something else?
    3. If possible, can you use default align attribute name instead for better compatibility please?

    Thanks for the answer in advance!

    Best regards,

    Oliver

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey,
    1. Not a good reason. Early on (over a year ago) when I was initially developing this plugin I was following with what courses and documentation was available, in Zach Gorden’s course he used blockAlignment and I followed that markup = https://github.com/zgordon/gutenberg-course/blob/1a77de8d01d1eb0a961b7387cb333461198d70d1/blocks/04-block-alignment-toolbar/index.js#L49
    2. No.
    3. Yeah, I can look at changing. I haven’t been aware of compatibility issues. Can you give me an example of what you are trying to accomplish?

    Thanks!

    Ben

    Thread Starter WebMan Design | Oliver Juhas

    (@webmandesign)

    Hi Ben,

    Thank you for explanation and for your will to look into updating the attribute name if possible.

    In my theme I am adding a Gutenberg compatibility currently. And while having trouble with wide & full alignment for all theme layouts, I’ve decided to wrap all such aligned blocks in a helper div.align-wrap. This div is applied via render_block filter on blocks with align attribute set to wide or full.

    Trying to figure out why the wrapper was not applied on Kadence Blocks I’ve noticed the change in naming of the attribute. I am currently using a workaround in my code for this, but it would be great if any block plugin used WP native attribute names wherever possible.

    (BTW, I completely understand it’s not your fault. Gutenberg should have been designed more carefully, future proof, especially by the time it was released with WP…)

    Thanks again!

    Oliver

    Interesting, I’ve not seen anyone adding fullwidth support that way. Just out of curiosity can you tell me what css your applying to the wrapper and then block?

    Ben

    Thread Starter WebMan Design | Oliver Juhas

    (@webmandesign)

    Hey Ben,

    The wrapper is unnecessary in most cases as most of the websites are fullwidth nowadays anyway. But in certain cases, like when your theme supports boxed layout or other “wilder” layouts, the wrapper can simplify styling a lot, in my opinion.

    I’ve actually written an article some year ago about this, with CSS code examples: https://codepen.io/webmandesign/post/gutenberg-full-width-alignment-in-wordpress-themes

    Regards,

    Oliver

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Align attribute name’ is closed to new replies.