Overview
Descoped from #3517741: Content templates, part 1: introduce the `ContentTemplate` config entity type.
The ContentTemplate config entity is attached to a specific entity type, bundle, and view mode. At the moment, we only require that the bundle exist at all, but we don't check that the bundle is actually usable by XB. We should validate that, but it'll have to happen once the blocker is in.
Proposed resolution
Add support for content templates for entity types that have $entity_type->get('field_ui_base_route') set to match the logic that's used to determine whether an entity type can have display modes or not. This means we can rely on Field UI to tell us what is eligible.
Templates for additional entity types should displayed as siblings of the current Content Types details element:

User interface changes
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #28 | Screenshot 2026-03-23 at 3.01.57 PM.png | 122.15 KB | mglaman |
| #28 | Screenshot 2026-03-23 at 3.01.32 PM.png | 126.92 KB | mglaman |
| #27 | Screenshot 2026-03-23 at 14.25.14.png | 250.74 KB | lauriii |
Issue fork canvas-3518272
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:
Issue fork experience_builder-3518272
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 #2
wim leersComment #3
effulgentsia commentedThe assumption the way this issue is worded is that XB should only allow content templates for entity types and bundles for which XB will be able to allow editing individual entities of. For example, only entity types that implement
EntityPublishedInterface. But I wonder if that's correct, so assigning to @lauriii for product-level guidance. Because another way we can go here is to allow content templates for all entity types and bundles, even ones for which editing the individual entities can only be done outside of XB. For example, we could release XB 1.0.0 with the ability to edit content templates for nodes but not yet the ability to edit the individual nodes within XB. And if we can do that for nodes, then why not for content entity types that XB might never provide the ability to edit the individual entities of?Comment #4
effulgentsia commentedAlso, what might make sense here is for XB 1.0.0 to only allow content templates for nodes, and punt any support for creating templates for other entity types (e.g., paragraphs, custom blocks, etc.) to after 1.0.0.
Comment #5
lauriiiI agree that
EntityPublishedInterfaceseems indeed like a restriction for editing entity content in XB, not to build templates for the entity. I'm wondering if relying on the existence ofview_builderfor the entity type would be too broad?Comment #6
lauriiiContent Templates is still a priority for stable, but we're tracking it separately.
Comment #7
wim leers+1 — this is what I was thinking. Assuming we do that, I agree with removing the tag, if we first land a basic MR here that does this:
(And then keep the issue open for the wider scope.)
Comment #9
wim leersMR up for #7. Assigned to @lauriii for review — if he approves/merges, then I'm happy to remove the tag 👍
Comment #10
wim leersAdjusting title temporarily for the MR up for review in #9. Once it's in, we should restore the title
[PP-1] Validate that content templates are attached to content entity types (+ bundles) that fulfill XB's requirements.Comment #11
lauriiiApproved
Comment #12
wim leersHah, the tests are failing legitimately:
This is because #3538487: Don't allow passing uncollapsed inputs if using default expression just introduced a
ContentTemplateforxb_page— whereasxb_pagecontent entities should never get content templates, because they're explicitly intended for one-off (landing) pages! 😅 This just reaffirms my belief we should strictly validate config.Comment #14
wim leersThanks, @lauriii!
Comment #15
wim leersThat'd mean a very bifurcated experience: some things can be edited in XB, some things cannot, etc. It also means going back to the usability reality that has frequently been lamented: being forced to navigate a complex, abstract admin UI where the connections between concepts are hard to discover and hence require a steep learning curve.
We might need to do this eventually to bring support for the full suite of content entity types in Drupal core & contrib. But … I don't think that's necessary at this time. I would urge to pretty please do this in a multi-phased approach:
nodecontent template support (see #7 and its MR)Yes, @lauriii is right in #5 that
EntityPublishedInterfaceis about the content entity editing experience, because XB's current auto-save architecture needs the ability to publish (to work at all).While we may very well be targeting only the "pure"
ContentTemplatepart for 1.0/DrupalCon Vienna, without support for exposed slots, we do need to think ahead towards the future where a site builder creates aContentTemplatewith >=0 exposed slots (typically >=1), and the content author populates those exposed slots in Experience Builder.Once that's the case, it'll also be reasonable to expect that the "navigator" in the top bar allows searching not only
Pagecontent entities, but any content that can be created or edited in XB, so also for example nodes. And so on and so on. Which is exactly why the list of eligibility criteria in #3498525: [META] Allow Canvas to be used on any content entity type (bundle), as long as it has certain entity type characteristics is what it is.Comment #16
wim leersComment #18
lauriiiI'm detaching this from #3498525: [META] Allow Canvas to be used on any content entity type (bundle), as long as it has certain entity type characteristics because at the moment I see adding support template creation for all entity types as a higher priority than adding support for full editing of Nodes within Canvas.
Comment #19
wim leersAgreed with that, but since the title says , we still need to know those requirements anyway. The meta you detached this from doesn't have a final set of requirements though, so we can't really start doing anything here. I see you commented on that aspect in #45 over there, I responded in #46 👍🏓
Comment #20
lauriiiI'm not convinced that the requirements for creating a content template would have to match those that define which entity types can be authored in Canvas. The real dependency is from #3455629: [PP-1] [META] 7. Content Templates — aka "default layouts" — affects the tree+props data model to define which content templates can have exposed slots.
Comment #21
mglamanLooks like the requirement is to check if entity types have `$entity_type->get('field_ui_base_route')` which is what Field UI does to determine eligibility for site building.
Comment #22
phenaproximaComment #24
phenaproximaThis simplifies validation a tad.
Comment #25
penyaskitoAppreciate the enthusiasm here.
I think we should convert this into a meta. There is no proposed resolution in the IS, and I think this isn't hard but also non trivial, so can result in a huge MR.
AFAIK we need to:
\Drupal\Tests\canvas\Functional\ApiUiContentTemplateControllersTestto use an entity type different than node.componentAndLayoutApihas hard-coded `node` in some places (so far I've foundgetViewModes, maybe that's the only one? 🎉).ui/src/components/sidePanel/Templates.tsxassumes: Content Types label + only one accordion. I'd expect we need to have a three level tree now?AddTemplateDialogassumes a content templates are only for nodes (hard-coded). We would need a new selector for the entity type first.templates.spec.ts.And I did look into this for 30 minutes. When we are deep into this I'm sure more things will arise. Per the nature of the work (backend vs react) + the amount of changes I'm convinced we should be splitting this.
Comment #26
penyaskitoI forgot the optimist part: on the positive side, lots of the infra for this is in place, and it's generic for entity types as a whole, not nodes. Maybe splitting this would also help to get multiple contributors getting it done during Chicago2026 😇
Comment #27
lauriiiUpdated the issue summary with the details that we discussed at DrupalCon for implementing this.
Comment #28
mglamanWorked on it. Preview
Working on words. "content type" needs to be changed to something more dynamic
Comment #29
wim leersHigh-level review posted — I like where this is going! 👏
Comment #30
mglamanComment #31
mglamanI'm going to retitle this. We decided the requirement (opted into Field UI). I'm poking at the CI but thisis now reviewable.
Comment #32
mglamanI'll work on the failing test and feedback about bundle-less entity types
Comment #33
mglamanAddressed test fail + lauri feedback