Content templates, part 3b: store exposed slot subtrees on individual entities

Created on 15 April 2025, 6 days ago

Overview

In ✨ Content templates, part 2: store a component tree in the template, and allow individual entities to fill in specific slots in that tree Active , we introduced the ability for a content template to define which empty slots in its tree should be "exposed", to be filled in by individual entities.

There is currently no way for individual entities to provide the subtrees that should fill in those slots, to be assembled for final rendering. Let's add that in this issue.

Proposed resolution

I discussed this with Wim and he felt that we should allow subtrees to be stored as single items of infinite-cardinality component_tree fields targeting specific slots.

So what does that mean? Well, it means each item in such a field will consist of three properties:

  • tree: The component tree, as JSON -- what we've already got.
  • inputs: The inputs for each component, as JSON -- what we've already got.
  • slot: The machine name of a slot in the template (which, for the record, is always the full view mode's template) which this item will fill out. This property can also be NULL, which presumably means that the field item has the tree root UUID (although what this means in practice is unclear right now).

In other words, the component_tree field item will be changed to allow any number of items.

These subtrees should be pulled into the template's final component tree at render time.

User interface changes

None. This is all internal data layer stuff.

✨ Feature request
Status

Active

Version

0.0

Component

Theme builder

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • Merge request !909Add slot property to ComponentTreeItem β†’ (Open) created by phenaproxima
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    FYI this is inspired by what I proposed to @effulgentsia while discussing πŸ“Œ [PoC] Introduce a `ContentTypeTemplate` config entity Active , and which he encouraged to explore:

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • Pipeline finished with Failed
    5 days ago
    Total: 1458s
    #475070
  • Pipeline finished with Failed
    5 days ago
    Total: 502s
    #475352
  • Pipeline finished with Failed
    5 days ago
    Total: 1400s
    #475356
  • Pipeline finished with Failed
    5 days ago
    Total: 576s
    #475380
  • Pipeline finished with Failed
    5 days ago
    Total: 1552s
    #475389
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Been contemplating this for a couple of days.

    I think what each item in a multi-cardinality XB field needs to look like is...a full tree. With a root UUID and everything.

    The reason I need a root UUID is so that the content template, which assembles the final renderable tree, knows which part of the tree goes directly into the exposed slot, and which parts of the tree are just NestedArray::mergeDeep()'ed into the main tree (since it seems that the tree structure is never more than three levels deep).

    In other words, given a single mini-tree loaded from an entity and targeting a particular slot in the template, the root of the mini-tree goes directly into the exposed slot, and the rest of the tree is just added to the main tree.

  • Pipeline finished with Failed
    4 days ago
    Total: 1767s
    #476218
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • Pipeline finished with Failed
    3 days ago
    Total: 1510s
    #476749
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Okay -- needs test coverage (quite a bit of it, I'd think), and validation, but I've at least implemented my first stab at the render-time logic. Could use a quick review to confirm I'm not way off-base here.

  • Pipeline finished with Failed
    3 days ago
    Total: 1590s
    #476773
  • Pipeline finished with Failed
    3 days ago
    Total: 315s
    #476827
  • Pipeline finished with Running
    3 days ago
    #476841
  • Pipeline finished with Failed
    3 days ago
    Total: 322s
    #476837
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Okay, this has a test now, so removing the tag. There are still some data integrity questions here, though, which surely means this is a stable blocker.

  • Pipeline finished with Failed
    3 days ago
    Total: 258s
    #476938
  • Pipeline finished with Canceled
    3 days ago
    Total: 117s
    #476940
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Failed
    3 days ago
    Total: 1632s
    #476941
  • Pipeline finished with Failed
    about 11 hours ago
    Total: 853s
    #478441
  • Pipeline finished with Failed
    about 11 hours ago
    Total: 1588s
    #478444
  • Pipeline finished with Failed
    about 10 hours ago
    Total: 1701s
    #478464
  • Pipeline finished with Failed
    about 8 hours ago
    Total: 1956s
    #478562
Production build 0.71.5 2024