feat(Headless): #3591962 Enable page variants in Canvas Headless

  • adds support for page variants in Canvas Headless content api, editor preview and headless SDK

Testing instructions

  • build ui and packages and enable canvas_headless
    • npm run build
    • npm run packages:build
    • ddev drush cr
    • npm link -ws
    • ddev drush en canvas_headless
  • create a headless app: npx @drupal-canvas/create@latest --experimental-headless --template nextjs
  • start headless app
    • npm link @drupal-canvas/headless @drupal-canvas/headless-next @drupal-canvas/headless-react (if using a template other than the nextjs, link @drupal-canvas/headless and framework adapter matching the template)
    • npm run dev
      • for nextjs template use npm run dev -- --webpack, turbopack doesn't work with linked dependencies
  • configure headless frontend in Canvas
  • verify that page templates can be created/edited using headless editor frame
  • verify that when previewing in Canvas editor pages or full content templates their assigned or site default page template is displayed around their content
  • verify that content api returns in content full component trees including page templates
    • verify that page templates are displayed for published pages viewed in frontend app

Closes #3591962


AI-Generated: Yes (Used Codex to work on implementation).

Edited by wotnak

Merge request reports

Loading