[Pages]: How to fetch static data for a Layout
Unanswered
Asari posted this in #help-forum
AsariOP
Hi, in one of our e-commerce website we need to populate a menu(which lives in a shared layout for all pages) with few products set by our CMS
Similar to the screenshot in netlify website, we need to render this dropdown menu content on build time, so users wont see any delay loading products
one way i thought is to build a json from top products at build time and import it in the layout at build time to showcase menu, but there should be a better way
Similar to the screenshot in netlify website, we need to render this dropdown menu content on build time, so users wont see any delay loading products
one way i thought is to build a json from top products at build time and import it in the layout at build time to showcase menu, but there should be a better way
2 Replies
@Asari Hi, in one of our e-commerce website we need to populate a menu(which lives in a shared layout for all pages) with few products set by our CMS
Similar to the screenshot in netlify website, we need to render this dropdown menu content on build time, so users wont see any delay loading products
one way i thought is to build a json from top products at build time and import it in the layout at build time to showcase menu, but there should be a better way
yes... in the pages router that's pretty much the only way
AsariOP
😦