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.

Command icon 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

fago created an issue. See original summary.

fago’s picture

Status: Active » Needs review

Added first MR adding the necessary code-changes. cache-invalidation was a bit tricky, but got it working fine.

  • fago committed 57495692 on 3.x
    feat: #3587388 Add support for canvas content templates
    
    By: fago
    
fago’s picture

Status: Needs review » Needs work

merged, but let's add another MR to reflect this in the UI

fago’s picture

Title: Add support for canvas conent templates » Add support for canvas content templates
Status: Needs work » Needs review

added another MR for the UI.

  • fago committed 04a322f4 on 3.x
    feat: #3587388 Make UI reflect when canvas content templates are used...
fago’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.