The Canvas Override and Reset Canvas layout actions on a content item.
The Canvas layout tab on a content type, with per-content Canvas layout editing switched on.
A component prop bound to the content title, with the link-to-field control beside it, on a per-content layout.

Canvas Override 1.0.3 - CI Canvas Override 1.0.3 Cucumber Automated Functional Acceptance Testing report Canvas Override documentation

Canvas Override lets site builders turn on per-content layout editing, built on Drupal Canvas, for the content types they choose.

Canvas gives a content type one shared Content Template. Canvas Override adds the other half: any individual content item can depart from that template and keep its own layout, edited in the same Canvas editor. Content that has not been customised keeps following the shared template, so a change to the template still reaches everything that has not been overridden.

What you get

  • A Canvas tab on content of the types you enable, opening the full Canvas editor for that one item.
  • A per-item layout stored in its own field_canvas_layout field, versioned with the node like any other field.
  • Reset Canvas layout, which drops the custom layout, restores the shared template, records a revision, and clears any pending Canvas auto-save.
  • Per-content-type and per-bundle permissions: use Canvas Override, reset a layout, and edit the shared default template are separate grants.
  • Components seeded from the Content Template keep their field bindings, so a heading bound to the title stays bound after you restyle it.

Requirements

Installation

composer require drupal/canvas_override
drush en canvas_override

Then edit a content type, open the Canvas layout vertical tab, and enable it.

No Canvas patch needed

As of 1.0.1 this module runs on a stock Canvas release. Earlier versions needed the #3567225: Allow per-node override of Content Template via checkbox in node selector patch, because Canvas ships Drupal\canvas\Storage\ComponentTreeLoader as a final class and several Canvas services type-hint that concrete class.

When that patch is not applied, Canvas Override loads its own copy of that class under Canvas's class name through a prepended autoloader. This happens only while the installed Canvas actually declares the class final; on a patched Canvas, or any future Canvas release that drops final, the module stands aside and Canvas's real class is used.

Worth knowing:

  • Install with Composer. The autoloader is registered through the package's autoload.files entry, so copying the module into web/modules/contrib/ by hand skips it and per-content editing stays off.
  • Under opcache.preload Canvas's class is already in memory before Composer's autoloader runs, so the replacement stands aside and per-content editing stays off. It does not fail hard.
  • The copy is re-synced with Canvas's own file on each Canvas release.
  • The durable fix is still upstream: land #3567225: Allow per-node override of Content Template via checkbox in node selector, ideally alongside a ComponentTreeLoaderInterface.

Known limitation

The link-to-field control renders on a per-content layout and lists the item's real fields, but applying a link is blocked inside Canvas's compiled front end, which resolves that action through its content-template endpoint. That is upstream in Canvas and cannot be fixed from this module.

Supporting organizations: 
Initial building, ongoing maintenance and development

Project information

Releases