Suncel home pageSuncel logoSuncel v1.1
  1. Context

Configuration > Context

Suncel 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. 

Wrap your App

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;

Properties

type SuncelContextType = {
  contentTypes?: ContentTypeSchema[];
  globals?: GlobalSchema[];
  menuBlocks?: MenuBlockSchema[];
  children: React.ReactNode;
}

Property

Definition

Required

contentTypes

Array of all the contentType that your project use

no

globals

Array of all the Global that your project use

no

menuBlocks

Array of all the Block that your project use

no