Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The goal of #2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase is to move the functionality of Field Layout directly into the EntityDisplay system and Field UI.
In order to accomplish that move, several changes must be made to existing core code, this is one of them.
Layout regions are defined by the layout definition, and should be rendered on the page in that order.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#5 | 2851648-layoutregions-5.patch | 2.97 KB | tim.plunkett |
#5 | 2851648-layoutregions-5-interdiff.txt | 911 bytes | tim.plunkett |
#2 | 2851648-layoutregions-2-PASS.patch | 2.95 KB | tim.plunkett |
#2 | 2851648-layoutregions-2-FAIL.patch | 2.02 KB | tim.plunkett |
Comments
Comment #2
tim.plunkettComment #4
jibranLet's call it $region_name. It helps in avoiding the confusion between $region and $regions.
Comment #5
tim.plunkettSure
Comment #6
jibranThanks!
Comment #9
xjmOK.
The number of regions should not be large enough that which way it is sorted matters, although since these are render arrays the child elements could get quite massive. But the render system has to do orders more manipulation that that, and after all that's what render caching is for. Would be premature optimization to worry about that more here, I think.
It's tested. Expected ordering of things is good. I asked @tim.plunkett about config sorting but he pointed out that the only configurable core implementation yet just adds a single region as one configured property of each field, so the sorting of the regions is not applicable to that.
Since this is an alpha experimental module, this change is eligible for 8.3.x. Committed to 8.4.x and 8.3.x. Thanks!
Comment #10
tim.plunkettFor the record, this works instead of the foreach, but I found it incomprehensible: