Hi guys, there is any Example of using InlineBlocks with Strapi??
Thank you
Hi guys, there is any Example of using InlineBlocks with Strapi??
Thank you
I’m having issues with this also and I dont see any examples for InlineBlocks in the article you referenced. It looks like Tina needs to have a field called _template
in each block object to identify which template to use (Inline Blocks | TinaCMS Docs) however Strapi doesn’t allow this naming convention (at least for text fields). It looks like Strapi does include a default field called __component
though, would there be someway to have Tina look for this value instead of _template
?
Here is an example output from my current setup in Strapi:
[
{ __component: “sections.hero”, id: 1, title: “The best way to build your Corporate Site” },
{ __component: “sections.feature-rows-group”, id: 1, features: [] }
]
Ok I was able to get this to work using Graphql Aliases, I just added a default (uneditable) text field called template
to each of my “blocks” and then aliased it as _template
in my query.
I also needed to change the format of the blocks object passed to Tina’s InlineBlocks from:
const HOME_BLOCKS = {hero: heroBlock, images: imagesBlock, paragraph: paragraphBlock, features: featureListBlock}
To:
const HOME_BLOCKS = {"blocks.hero": heroBlock,"blocks.images": imagesBlock,"blocks.paragraph": paragraphBlock,"blocks.features": featureListBlock}