Answers about slots
Questions and answers from the Croct community about slots.
What is the cleanest way to render a personalized hero in an App Router server component?
wiring my first Croct slot into an App Router page. the hero is personalized and I want it to arrive already rendered, not pop in and swap after the page…
Should I pin the slot version in fetchContent or is leaving it off fine?
Some examples use a slot id like home-hero@2 and others just the bare home-hero. What is the practical difference between the two? We publish content changes…
If I change a Sanity component's fields, does it break the mapped Croct slot?
We iterate on our Sanity component schemas fairly often, adding and renaming fields as the design evolves. My worry is that editing a component's fields…
A content publish broke my build because the slot type changed, how do I stop that?
A colleague published a schema change on one of our slots this morning, and my very next build started failing because the content shape had changed under me.…
Does the VTEX integration also render personalized content or just track events?
I installed the GTM tag and I can see the events arriving on the dashboard, so that part is working. But I am confused about how the personalized content…
For personalized blocks, should the copy live in Sanity or in Croct?
I am designing how content is authored across our Sanity project and Croct, and I want to get the data model right before anyone starts building. My main…
Best way to get typed slot content in a TypeScript Hydrogen project?
Our Hydrogen storefront is strict TypeScript, no implicit any, and I would like slot content to be typed end to end rather than casting the fetch result to…
How do I get TypeScript types for the content a slot returns in React?
I am tired of treating slot content as any in my React components. Right now I destructure useContent('home-hero') and TypeScript has no idea what the fields…
How do I get the content from a slot properly typed in TypeScript?
wiring up content fetching and the content coming back is basically unknown, so I get no autocomplete and no safety on the fields. Right now I am casting it…
How many Croct slots do I need for a homepage with several personalized blocks?
Scoping a Storyblok homepage where three blocks would be personalized: the hero, a promo strip, and a testimonials block. Before I commit I want to understand…
Where do I call fetchContent for a Storyblok-mapped slot in the App Router?
App Router site rendering Storyblok stories, and I have mapped a hero block to a Croct slot. I want the personalized content to arrive server-rendered so…
A content publish broke our prod build, was it because we did not pin the slot version?
Someone on the content side published a schema change to a slot and our Next app immediately started getting content that did not match our types. Here is…