This is a Next.js project bootstrapped with create-next-app.
This template showcases the following Optimizely CMS SDK capabilities:
- Content Types: Defining and working with custom content types
- Display Settings: Creating and rendering components with display settings
- Page and Experience Rendering: Rendering CMS pages and experiences (blank experiences and sections)
- Preview Mode: Setting up and configuring live preview/edit mode
Run the command:
pnpm exec optimizely-cms-cli loginRun the command:
pnpm exec optimizely-cms-cli config pushCopy .env.example into .env. Open the file and add the required environmental variables
- Go to your CMS and create a page with type "Landing Page".
- Do not forget to fill the "Name in URL" field
- Publish the content.
Start the app
pnpm dev-
Open
https://localhost:3000/<lang>/<slug>, where<lang>is the language code (for exampleen) and<slug>is the name in URL of the previous step.You should see the content of the page rendered with the components in the project
-
Go to
https://localhost:3000/json/<lang>/<slug>You should see the content of the page in JSON.
-
Go to your CMS and then "Settings" > "Applications".
-
Click "Create Application"
-
Set the following values:
- Application Name: "test"
- Select the content you have created as a start page.
Click "Next"
-
Click "test" (the application you have created) to open its settings and then "Hostnames"
-
Click "Add Hostname..."
-
Set the following values:
- Hostname:
localhost:3000 - Check "Use a secure connection (HTTPS)"
- Locale:
all
Click Add
- Hostname:
In the CMS, go to the content you created in step 4 and edit. You should see the preview in the right hand side