feat: #3567225 Allow per-node override of Content Template via checkbox in node selector

Closes #3567225

Summary

Allows editing a Canvas layout on an individual node, overriding its Content Template.

  • A per-node Canvas editor (/canvas/editor/node/{node}) edits the node's own layout.
  • Field linking (dynamic prop sources) resolves against the node as the host entity. When editing a Content Template, the preview entity remains the host.
  • The Page Data panel is hidden in the per-node editor, and when drupalSettings.canvas.hidePageDataPanel is TRUE.
  • Prop-source suggestions are offered for node layouts, not only Content Templates.

Changes

  • Back end: ApiLayoutController selects the host entity per context; JsonSchemaPropsComponentSourceBase suggests prop sources for nodes; ComponentTreeLoader is made extensible.
  • Front end: ContextualPanel hides the Page Data panel; layoutModelSlice links props using the active editor frame context; Topbar/UndoRedo icon sizing; new hidePageDataPanel setting in DrupalSettings.

Testing

  • Open /canvas/editor/node/{node} for a node that uses a Content Template.
  • Confirm the Page Data panel is hidden.
  • Add a component, link a prop to a node field, and save.
  • Reload and confirm the linked value renders from the node.
  • Edit the Content Template and confirm template editing still works.
  • composer run lint and npm run lint pass.

AI usage disclosure

Per the Drupal AI contribution policy: AI (Claude Code, Opus 4.8) assisted with rebasing this branch onto the latest 1.x and resolving coding-standard, static-analysis, architecture-rule, and formatting violations (PHPCS, PHPStan, PHPat, ESLint, Prettier). All changes were reviewed and verified by the human contributor (Rajab Natshah), who is responsible for the logic, security, and licensing.

Edited by Rajab Natshah

Merge request reports

Loading