Motivation
Canvas has content templates. The canvas UI allows to create them. When using canvas_extjs pages + custom elements work great, it would be nice to be able to use content templates as well.
Most required parts seem to be already there and working, but some glue is needed to make the content template apply.
Proposed resolution
1. Follow layout-builder integration work and how canvas works.
2. When a canvas content-template is there, auto-apply it.
3. When applying a content-template, render it into a component slot on the node/entity and keep other configuration as well. The same way as we do it with layout-builder. So you can ship-over some other entity-data to the frontend outside of components, if you want to.
4. Let's make the ce-display default to use a canvas-* prefix to the usual entity display name, so it renders via a canvas--default.vue. We simply need to rename our canvas-page--default.vue accordingly.
5. Make UI aware of this and inform the site-builder about the canvas rendering + present button to the UI, as done by canvas on the main entity-build page. Do this is a second MR.
Remaining tasks
Implement, add tests.
Issue fork custom_elements-3587388
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
fagoAdded first MR adding the necessary code-changes. cache-invalidation was a bit tricky, but got it working fine.
Comment #5
fagomerged, but let's add another MR to reflect this in the UI
Comment #7
fagoadded another MR for the UI.
Comment #9
fago