Warning
This repository is out of development and has been made available as a starter sample and an npm package.
NOTE: Latest supported version: Sitefinity CMS 14.2.7924.0 and above
The sample code in this repo implements a decoupled frontend SPA renderer for Sitefinity CMS. It uses the Sitefinity Layout API services to render the layout and widget content in Sitefinity MVC pages. The sample code uses the React framework.
The sample supports:
- Local Development on any node.js supported OS
- Integration with thw WYSIWYG editor
- Server-side rendering with Next.js
- Widget development with React
- OOB widgets - Section, Content list, Content block
- Rendering of pages created through the 'Next.js Renderer'
To quickly set-up a dev environment, look at the docs in CI & CD.
To learn more about widget development, look at Widget development
Install the modules:
npm install
Run the server:
npm run dev # Runs in dev environment.
NOTE -> Running under https requires a valid https certificate to be installed. Checkout the SSL doc
The server.js file is used to configure the server under https.
The Next.js Renderer uses the 'app router' by default. Since all of the pages are located on the CMS, all of the routes are fetched dynamically through the generateStaticParams method in the slug file or dynamically if static generation is not used. All of the pages for the Renderer of type 'React' are fetched and are rendered.
- 'SF_CMS_URL' -> The URL of the CMS for server-side requests.
- 'SF_CMS_URL' -> The URL of the CMS for server-side requests.
In order to use static generation, uncomment the generateStaticParams method in the slug file. Then run the command
Run the command:
npm run build # Runs in production environment.