Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

HomeDev GuideRecipesAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

Preview for headless sites

Explore Optimizely CMS 13 Pre-release Preview features: custom routing for headless websites, live preview management, and reusable preview tokens.

Administrators can optionally configure custom preview URLs in Settings (admin mode).

Custom preview routing for headless websites

Added custom preview routing functionality within Settings > Preview routing, letting administrators toggle Preview enabled on or off to configure how preview URLs are generated at the application level.

When "Preview enabled" is active

  • Applications default to one fallback route with a standard format.
  • Administrators can edit the fallback route using predefined tokens.
  • Administrators can add new routes for specific base types using predefined tokens.
  • Administrators can delete any route except the fallback route.

When "Preview enabled" is inactive

  • No preview formats are available, and administrators cannot add new formats.
  • Provided a set of predefined tokens (Context, Host, Key, Locale, Path, Segment, Version) that can be inserted into URL formats when configuring preview routes are editing preview routes.

Live preview route management for administrators

Added the Live preview section within the CMS Admin UI for managing live preview routes for applications. Administrators can carry out the following actions:

  • Enable or disable preview for the entire application.
  • Select whether to Use Preview Tokens.
  • Update the default fallback preview route.
  • Add or update existing preview routes for specific content types.
  • Remove preview routes for specific content types.
  • Use the search dropdown to locate content types when adding routes, including base types and content types, using the same UI component as Allowed Types.
  • Input free text for route definitions while preventing the creation of duplicate items for the same base type or content type.

Configurable preview routing for editors

Added configurable preview routing for editors, ensuring that the preview accurately reflects the configured route for the content type being edited.

  • Added notifications for editors when preview routing is disabled for the current application.
  • Added verification that when a preview route is configured for the specific content type being edited, a URL is used.
  • Applied the following routing logic for both Preview and On-Page Edit modes:
    • Prioritize the base type if no specific content type route is found.
    • Prioritize the fallback route URL when no specific or base type preview route is configured.

Automatic application default configuration update

Automatically updates existing applications to ensure correct default values for preview routing are applied when a version upgrade is deployed.

  • Updates all existing remote websites (applications) to have the following conditions set:
    • Preview enabled set to true
    • Use Preview Tokens to true
    • Automatic Preview Refresh to false
  • Configured one default route for Page and Block base types, matching the current format.

Preview request handling for frontend applications

Added support to simplify handling preview requests for frontend applications, including Graph requests and rendering content with correct HTML attributes for preview interactivity.

  • Provided support for loading specific preview versions of content.
  • Ensured that unpublished data loading utilizes the preview token.
  • Configured loading a specific preview version to bypass the query cache, ensuring retrieval of the latest data.
  • Added support for rendering the necessary HTML attributes for frontend application preview interactivity.

Reusable preview tokens

Added reusable preview tokens by modifying the validation process.

  • Changed preview token validation to verify the principal's permissions to the routed content, rather than validating the token's content reference against the routed content reference.
  • Ensured that user access to content is still validated.