Configuration > Context
Suncel Context is the core system allowing all the entities related to Suncel to communicate with each other. It will share the values and configuration between the Admin, blocks, and the page render.
In order for the Suncel Context to works, it needs to wrap all the element using Suncel, meaning the Admin and pages who are rendered via Suncel.
The easiest way is to wrap your entire App with it in the _app
of your project.
import "../styles/globals.css";
import type { AppProps } from "next/app";
import { SuncelContext } from "@suncel/suncel-nextjs-package";
function MyApp({ Component, pageProps }: AppProps) {
return (
<SuncelContext>
<Component {...pageProps} />
</SuncelContext>
);
}
export default MyApp;
type SuncelContextType = {
contentTypes?: ContentTypeSchema[];
globals?: GlobalSchema[];
menuBlocks?: MenuBlockSchema[];
children: React.ReactNode;
}
Property | Definition | Required |
---|---|---|
| Array of all the contentType that your project use | no |
| Array of all the Global that your project use | no |
| Array of all the Block that your project use | no |