Move layout builder code into processor service

Created on 26 August 2024, 3 months ago
Updated 19 September 2024, 2 months ago

Per #3469268-3: Rename layout-section element to drupal-layout :

Looking at the code, I think it would make sense to move it into a generator service + to invoke the CE-generator with the render array being $data. Then we have a place where we can improve this + allow contrib to override defaults.

suggest to create a custom elements processor plugin for layout section entity

---

(Note roderik: please add/change this description as necessary. I just copied the above from a thread, so I the issue could be closed.)

I believe this is meant to move all of CustomElementGenerator::buildLayoutBuilderContent() into a Processor class, i.e. make a processor for the whole 'layout entity', not for individual 'section entities'?

Edit: now, it makes more sense to me to indeed process individual sections. They're not strictly entities, but a processor can process anything. This needs a bit of testing though, while rewriting the code to (I assume) either not call -LayoutBuilderEntityViewDisplay::buildSections($entity) anymore, or to override it to use custom elements before generating the render arrays...

AFAICT this is not a requirement for a stable realease; can be added in a 'point release' without breaking any compatibility.

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇳🇱Netherlands roderik Amsterdam,NL / Budapest,HU

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

Comments & Activities

Production build 0.71.5 2024