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