Please fill out as many of the following questions as possible so we can help you promptly! If you don’t know how to answer or it does not apply, feel free to remove it or leave it blank.
Builder content link
e.g. Builder.io: Visual Development Platform
Builder public api key
go to Builder.io: Visual Development Platform and copy your PUBLIC api key
e2f096ba17f74dfd9c140ac050f349a4
What are you trying to accomplish
e.g. I want to integrate builder on a landing page
I am trying to render the blocks from the page builder model in the sidebar of a custom page but it only shows on the preview. I see it coming in when I log out the response from builder.io.
Screenshots or video link
Screenshots of your issue, or even better a link to a video of what is happening or what you are trying to accomplish. We love using loom for that sort of thing
What it looks like in the builder.io preview on localhost
What it looks like on the site after publishing and confirming the blocks are being returned by builder.io via console log:
Code stack you are integrating Builder with
e.g. NextJS, react, Shopify
NextJS, react
Reproducible code example
If you are having integration errors, please link to codesandbox or copy and paste your problematic code here. The more detail the better!
Not a complete code reproduction, but this is the NextJS page that is failing to render the sidebar built by BuilderComponent
and the blocks builder:
function BlogArticle({ article }) {
const isPreviewing = useIsPreviewing();
if (!article && !isPreviewing) {
return (
<>
<Head>
<meta name="robots" content="noindex" />
</Head>
<DefaultErrorPage statusCode={404} />
</>
);
}
console.log('article', article);
return (
// Wrapping the structured data in BuilderContent allows
// it to update in real time as your custom fields are edited in the
// Visual Editor
<BuilderContent content={article} options={{ includeRefs: true }} model="blog-page">
{(content) => {
if (!content) return;
console.log('content', content);
return (
<>
<Head>
{/* Render meta tags from custom field */}
<title>{content.title}</title>
<meta name="description" content={content.excerpt} />
{content.image && <meta name="og:image" content={content?.image} />}
</Head>
<Stack row maxWidth={1000} m="auto" p="$6">
<ArticlePost {...content} />
<Stack flexBasis="30%">
<BuilderComponent model="blog-page" content={content} options={{ includeRefs: true }} />
</Stack>
{/* Render the Builder drag/drop'd content */}
{/* <BuilderComponent model="blog-article" content={content} options={{ includeRefs: true }} /> */}
</Stack>
</>
);
}}
</BuilderContent>
);
}