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.hidePageDataPanelisTRUE. - Prop-source suggestions are offered for node layouts, not only Content Templates.
Changes
- Back end:
ApiLayoutControllerselects the host entity per context;JsonSchemaPropsComponentSourceBasesuggests prop sources for nodes;ComponentTreeLoaderis made extensible. - Front end:
ContextualPanelhides the Page Data panel;layoutModelSlicelinks props using the active editor frame context;Topbar/UndoRedoicon sizing; newhidePageDataPanelsetting inDrupalSettings.
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 lintandnpm run lintpass.
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