Site logo

Archived topic

Can we add custom data attributes to block items, specifically generateblocks?

3 replies · Started by Ben on September 23, 2020

Viewing posts 1–4 of 4

Is there a way to add custom data attributes to blocks, eg data-attrib-name="example" . Adding to Generate block containers is the main one.
Any way to do this?

Hi Ben,

At the moment, there's no option to add custom attributes to blocks on Gutenberg editor UI. The way to do it with the defaults is to select the block and edit its HTML to add the attributes you want.

If you want to add it on UI, you may have to use a plugin that extends block functionality. Or do it yourself with a bit of coding. reference - https://chap.website/adding-a-custom-attribute-to-gutenberg-block/

It's worth mentioning that GenerateBlocks Pro is in the works. We're still testing things out on our end but I can confirm that the Pro version definitely has this exact feature.

Thanks. I'll definitely get GB pro. Any ideas on lead time?

Thanks. I’ll definitely get GB pro. Any ideas on lead time?

There's no specified date for it as the current focus is on GP Premium and GeneratePress.

GP Premium 1.12.0 official release is scheduled for September 29th along with GeneratePress 3.0 release candidate. If all goes well, GeneratePress 3.0 will be up at around 1st week of October, perhaps on the 6th.

Only after that can Tom focus on GB Pro, which will probably take a couple of weeks. That said, it's really hard to give a definite date. Closest estimation would probably by 3rd week to end of October.

Please look forward to it.:)

This archived topic is closed to new replies.