Gutenberg-Block: supports: multiple => false

Hey there,

just purchased Pinegrow yesterday and I’m happy to be part of the community here. I’ve played around with the Test-Version before and also read a lot of your docs and watched a few Videos before buying it!

I like the product so far. I have mainly bought it to create custom Gutenberg Blocks for my customers to come away from the old, clunky ACF/Metabox Interfaces and provide a bit more flexibility. I’ve decided to do my first Project, which is a Jobportal, in Pinegrow!

Since their sites are not created by me and they rely on an old theme (maybe I can update that one day too :-D) I’ve decided to go with a custom Plugin instead of a Theme. There’s also a lot of extra functionality inside of the Plugins which will integrate automatically the job-posting with google-jobs and such stuff.

I guess that’s enough Context: I’ve encountered a little Problem for which I’ve a small workaround but I would appreciate if it could be integrated in any future Update. Maybe there’s already such an option and I wasn’t able to find it. If that’s the case please apologize my post!

I have created a template which preloads all Gutenberg-Blocks into the page when a new job-posting is created. So the layout is kind of prefilled, they only have to adapt the placeholders then. Now i would like to restrict the main-content Container (which holds a lot of nested stuff in it) and a few other nested containers, which were necessary to create 3 or 4 deep-nests, to be only used once on a page.

I know that Gutenberg-Blocks have that feature. So if I set supports: multiple => false the block could then only appear once per site (see here: Restrict Gutenberg Blocks to Single Use - Stack Overflow)

My workaround is to set the allowed parents to a random-number/chars. Which works, but if the client deletes the container by accident from that page he can’t bring it back.

Sorry for the long first post, hope you understand what exactly my Problem is. Otherwise please let me know and I try to explain it a bit further! :wink:

Thanks in Advance for your Help!

Cheers
Wolfgang

1 Like

Did you solve this @Wolfgang.Hartl ?

Unfortunately not.

I’m still using my workaround which is about the “allowed block types”, but that is really only a workaround and doesn’t stop them to use a block more than once if they really want to.

So I hope that in any future version the multiple support Attribute will be added to Pinegrow, @matjaz (just tagging you in case you’ve overread that post, it’s nothing which should have a high priority in my opinion, but still a nice feature)! :wink:

@Wolfgang.Hartl I started to work on that but then got distracted by your other requests :wink:

It is on the to do for the next release.

3 Likes

Hehe yeah a lot of input these days, and i hardly can’t believe that you already integrated that amount of requests (not only from me but also from the others) in that short period. So i have to speak out my compliments to the good work your doing!! I fell in love with Pinegrow and also with the way your treating customers, thanks for that! :wink: :confetti_ball::crown::tada:

6 Likes

Multiple=false was added. Out soon!

3 Likes

Ooooooh that is fantastic, awesome!!! Thanks! Just in time … I am just about to create a block where i really need it, and I thought I’m gonna do a shortcode meanwhile, but now I can use the full power of the block! :slight_smile: