Cannot load slices on homepage

Hello everyone,

Is this the right way to query for slices on the homepage?

<slice-zone type="homepage" queryType="single" />

It seems like no matter how I write this query I get “Your SliceZone is empty”. It works on the other pages when I use it like this:

<slice-zone type="page" :uid="$route.params.uid" :lang="$route.params.lang" />

Anything I should do differently?

I think you need to set the UID too. It will be whatever the UID is on your homepage document:

<slice-zone type="page" uid="homepage" :lang="$route.params.lang" />

Otherwise the uid will be undefined which I think is causing this error.

1 Like

Hey @ilie, Thanks for flagging this. Max was right, that the uid would fix the problem, but that’s actually an error. If you have queryType="single" and type defined, you shouldn’t need a uid. I’ve submitted a request to fix this, and I’ll let you know how it goes.

Update: this is now fixed. You can query a singleton like so:

<slice-zone type="your-single-type" queryType="single" />

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.