Closed giannis-koulouris-bb closed 1 year ago
Hi @giannis-koulouris-bb,
First of all, please know these GitHub Issues are not meant for personal support, this is where people raise bugs, so when you're using it for your personal issues you're holding up developers from fixing real bugs for the rest of the world using Gutenberg. That being said, I will try to point you in the right direction, assuming you didn't know this is not the right place to get support.
In your block's props there's a clientId. With this you can get the InnerBlocks' content from the data store and then do with it as you please. Read more about the data stores here.
Would you please close this issue? 🙂
Hey @thomasdevisser, your right, maybe that wasn't the right place to post my issue. Thank you for your help, I will close it now.
I'm creating a custom block for a 'Testimonial' CPT where user will have to fill the persons Name, Role & the Testimonial Text. This custom block is added automatically to each new post via Block Template and it's locked so the user can't add other blocks to that post.
Untill now for rich-text fields I was using the RichText component, with the
multiline="p"
attribute so user can add multiple paragraphs, now this attribute is deprecated and prompts me to use innerBlocks instead.I'm looking for a way to store this block's innerBlocks in the
testimonial_text
meta field. I know I could use the post content for that purpose, but I want to constrain the user's ability to add other blocks and also to create a nice interface where user can fill these 3 easily using the Gutenberg components instead of native custom fields.This is the code I'm using to register that block. Any help would be much appreciated.