Closed (fixed)
Project:
Drupal core
Version:
11.2.x-dev
Component:
field_layout.module
Priority:
Major
Category:
Plan
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 Oct 2018 at 20:37 UTC
Updated:
30 Jun 2025 at 03:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
effulgentsia commentedThis needs an issue.
Comment #3
effulgentsia commentedRetitling to what I understand this issue to be, but please correct me if I'm wrong.
Comment #4
tim.plunkettAdded the other child issue #2880746: [PP-1] Move Field Layout UI directly into Field UI
Both child issues need to be updated to clarify that they are only about the form portion, not the display.
Comment #5
aaronmchaleI have slight reservations about removing the Manage Display Field Layout customisations, Layout Builder seems a little over the top for just customising the Layout of fields in the display if that's all you need.
Say if someone has been using Field Layout to customise the Form Display, but then when they go to customise the View Display they can't unless they enable a separate module which has a drastically different workflow, when currently they can use the same module to customise both the Form and View Display. I can't see the logic in forcing that on people, and I can definitely envision the endless amount of feature request issues that this change will generate.
Comment #6
tim.plunkettIn that case, I'd just as soon remove the entire module and put it in contrib.
Comment #7
effulgentsia commentedI think parity between Manage Display and Manage Form Display is a worthwhile consideration. Out of curiosity, why not...
There may well be good reasons to not do any of the above, but just curious what they are.
Comment #8
aleksip+1 for moving existing Field Layout capabilities for both displays and form displays to Field UI.
Edit: That is, if any Field Layout capabilities are moved to Field UI.
Comment #9
roberto_araya commented+1 to comment #8
I think that Field Layout and Layout Builder are not exclusive, rather they are complementary, because in entities the view modes represent how I want the entity to look, and when I think of that entity as a whole page it makes sense to be able to use Layout Builder to arrange the elements, but there are other view modes in which I want to present the entity as if it were a design component (thinking of components such as Bootstrap), for example I might want to present an entity as a card, and have a card view mode to present that entity as a card (in terms of Bootstrap) and I don't want to manipulate the layout in that scenario, I just want to arrange the fields in the corresponding regions as Field Layout allows.
This is useful because later I can make use of that presentation (that card view mode), as a component (block) that I can position on some page with Layout Builder. And in both Panels IPE and Layout Builder it is possible in the case of blocks to select the view mode, so it is very useful to have view modes that represent design components, the point is that without Field Layout there is no way that a site builder can assign a design component to a specific view mode, and requires you to create a template for that view mode.
Comment #10
aleksipAdding related issue.
@roberto_araya you might want to check that issue out! :)
Comment #11
brianperryAlso want to check in to +1 the idea of moving field layout capabilities to Field UI. I also see Layout Builder and Field Layout as complimentary. Field Layout being more efficient for managing the layout of individual (or perhaps smaller scale) components and Layout Builder being the ideal place to manage the layout of multiple components together in larger regions or for the entire main content area of a view mode.
Comment #12
tim.plunkett#11
Except they currently work on the same exact level, and could never be used on the same entity display alongside each other.
I started back working on #2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase for those interested.
Comment #13
aleksip@tim.plunkett Different UIs would be used for different entity displays. So a non-visual one could be used e.g. for a paragraph type display, and a visual one for a node display.
Personally I'd just love to have some alternative non-visual layout UI in core, could be the alternative accessible Layout Builder UI too.
Comment #14
andypost+1 to move parts to field UI module and data model suitable for FL & LB to entity display (which is overriden by LB to add sections)
Also it may stand as solution to long lasting #1875974: Abstract 'component type' specific code out of EntityDisplay
Comment #15
jwilson3I just want to ask/clarify that because this is tagged Drupal 9, does this mean we have a good reasonable amount of time before we need to start thinking about refactoring existing sites that leverage Field Layout, do we gain anything by prioritizing this refactoring earlier than D9?
For context, I have 16 content types and 2 ECK entity types, and 3 to 4 Group module types that will need to be refactored (meaning touching all the twig templates with references to things like
{{ content._field_layout.content.field_myfield }}. This is a significant overhaul.Comment #16
tim.plunkettI'm not sure what the D9 tag implies, but this issue is filed against 8.7.x
I have to ask though, what's the point of using Field Layout if you are also overriding the templates and hardcoding
content._field_layout?That _ prefix on field_layout is explicitly there to indicate that it is an internal structure that shouldn't be manipulated from the outside.
There is NO backwards-compatibility promised on that key.
Comment #17
jwilson3Couple reasons
* To be able to group fields into certain regions and theme their wrapper divs in one single template. The theme allows two kinds of regions and fields in the layouts: edge-to-edge and constrained. Typically Paragraphs fields would be put into the edge-to-edge region, and other fields are placed above or below. The only way to theme this is to reach in and render content._field_layout.regionname
* Sometimes fields in one of these regions need additional theming rather than just throwing them inside the template stacked, thus when you have a site that starts out using a basic field layout, and need to override the display on one field, you have to further reach into content._field_layout.regionname.field_fieldname .
At the time the site was architected, Field Layout was the go-to tool for creating page layouts in core, in a way that was very similar to how CTools Layout templates worked in Drupal 7. It was much less cumbersome to use pre-defined layouts with preconfigured region names, rather than clicking through the UI using Field Group on each entity to build out groupings of fields. I'm totally open to suggestions on other ways that this should have been architected.
Screenshots depicting what I'm talking about:
Comment #18
lennard westerveldCan we please make some decisions about this topic? I would say we move it soon as possible to core #2844302 :)
Comment #20
kenton.r commentedThere is really no clarification as to what features are "essential features" to move and which ones are non-essential.
To be able to have multiple view (fields) displays for different components (for blocks and views) is needed.
To have the ability for different forms (form modes) of the same type/bundle to render is needed.
Would these be part of the essentials?
Comment #21
damienmckennaComment #23
catchIf we want to move functionality into core, that should be a new experimental module or core patch. If we want to remove field_layout because it's never going to leave the experimental state, then I think we should do that. I don't think the two are linked necessarily.
Tagging for review.
Comment #24
catchCross-linking #3099427: [random test failure] FieldLayoutTest::testEntityView().
Comment #25
catchBumping to critical since this blocks #3013276: [META] Remove deprecated modules on the Drupal 9 branch and we need to make a firm decision and implement it before beta, whatever that decision is.
Comment #26
damienmckennaShould a patch be uploaded here, given it's a meta issue, or should a sub issue be added for the code changes?
Comment #27
catchIf we decide on a straight removal I think it's fine to just have a patch here (also fine for there to be a patch to review while the decision is made). Apart from keeping the module in Drupal 9 as experimental I don't really think there's another option at this point.
Comment #28
damienmckennaOk then. This removes the module, removes it from core/composer.json, removes layout_builder_install() as it was focused on migrating displays from Field Layout to Layout Builder, and removes Drupal\Tests\layout_builder\Kernel\LayoutBuilderFieldLayoutCompatibilityTest as it just dealt with compatibility between the two.
Should we specifically create a contrib module for Field Layout to let folks continue it, or leave it up to anyone who wants to take on this responsibility to do the work? I'm inclined to do the latter.
Comment #29
dwwQueued #28 to run on 9.0.x core, hope that helps. ;)
Cheers,
-Derek
Comment #30
bnjmnmCreated a contrib for field layout https://www.drupal.org/project/field_layout
The field_layout path was available, but not the name "Field Layout" so the current name is "Field Layout (core)". This contrib should make it easier for D8 sites to update to D9.
I think layout_builder_install() should be brought back as it could be useful to sites updating from 8 to 9 that want to convert Field Layout data to Layout Builder.
Comment #31
bnjmnmThe drupal/field_layout requirement should also be removed from composer.lock
Comment #32
damienmckennaOh, good catch, I never noticed that file listed all the modules too.
Comment #33
damienmckennaWhoops, I was in the wrong terminal window when I generated those patches.
This should work.
Comment #34
jonathanshawMakes sense to me.
Comment #35
rfletcher73 commentedAs a Drupal 8 user who is using Layout Builder, Field UI, and Field Layout I have some question related to the removal of the Field Layout.
What was ultimately decided? Is the plan still to remove the Field Layout and migrate all of the functionality to Field UI?
And does that mean if I am using Field Layout when I upgrade my site to Drupal 9 (I assume that is when Field Layout will be removed completely) that my site will still work the same way it does now?
Or is there going to be some migration plan for devs using Field Layout?
Comment #36
catch@rfletcher73 the mitigation for removing it from core would be the contrib module: https://www.drupal.org/project/field_layout
We haven't yet confirmed whether we're going to remove it in 9.x or 10.x yet though.
If #2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase happened it would probably end up as a stub module rather than being removed as such, but not clear what the status of that issue is.
Comment #37
rfletcher73 commented@catch - thank you for your quick reply.
Comment #38
xjmDrupal 10. :)
We'll deprecate it in Drupal 9 once the useful bits are copied into core and the module becomes just a wrapper.
Comment #39
catchI think this is postponed on #2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase then.
Comment #40
gábor hojtsyReparenting.
Comment #41
gábor hojtsyComment #42
quietone commentedComment #43
quietone commentedComment #44
catchWhile there is no explicit plan yet, I think this is a more accurate issue title for what we'd like to happen.
Comment #45
andypostLB still doesn't support form modes, so the way remains #2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase
Comment #46
ressaShould we warn users that the module should probably not be used? I have created #3370887: Inform users that Field Layout is deprecated.
Comment #47
andypostComment #48
rkollerIn today's Usability Meeting #3418992: Drupal Usability Meeting 2024-02-09 we've discussed #3344498: Improve the manage form display page by untwining field widgets that belong to the main content and sidebar outlining an underlaying problem which is relevant for this issue as well as for the Field Layout contrib module. The issue illustrates that things are already problematic without Field Layout being installed and you only have an
enabledanddisabledsection on theManage form displaypage. But with Field Layout set to for example a two column layout the problem gets worse. We've agreed on postponing #3344498: Improve the manage form display page by untwining field widgets that belong to the main content and sidebar on this issue and bring it on everyone's radar.Comment #49
gábor hojtsy@andypost highlighted that this has a product manager review tag. While there is a page building initiative being bootstrapped which will shine a lot more light on layout building that we did in recent years, I doubt that changing how forms are laid out will be a priority of that initiative either anytime soon. So my feeling is this issue will keep lingering here like it did throughout Drupal 9 and 10. If we want a "clean solution" we can deprecate and move it out to contrib like other core modules. Ideally it would be folded into layout builder, but that clearly did not happen in years.
Comment #50
quietone commentedIn an effort to get this moving I am setting the status to active. There is discussion here on a) moving it to contrib and b) to copy all the useful bits to core. The latter being in #8 and the child issue. The latest comment supports "If we want a "clean solution" we can deprecate and move it out to contrib like other core modules."
I would prefer the clean solution which is to deprecate and move to contrib and in Slack catch said the same. Shall we pursue that?
Comment #51
quietone commentedComment #52
catch#2844302: Move Field Layout data model and API directly into \Drupal\Core\Entity\EntityDisplayBase is a complete re-implementation of what field_layout tried to do, so I don't think we are really gaining anything by keeping it in core until that's done - the only reason to do so would be to provide an 'upgrade path' for sites using the experimental module, but we don't even know if that will be the case. So I think it's clearer if we move the module to contrib, on the basis some sites might be using it and we don't want to them to be left in a complete dead-end. It's been several years since field_layout was abandoned and keeping it in core isn't helping us replace it.
Comment #53
catchRemoving the 'needs release manager review' tag too given +1s from both me and @quietone.
Comment #54
ressaAdding "Add Field Layout to Deprecated and obsolete extensions" under Remaining tasks.
Perhaps add it now, and state that it "will be removed in a future version"?
Comment #55
andypostComment #56
quietone commentedOK. product and release managers agree to remove Field Layout from core.
That will be done in #3517712: [meta] Tasks to deprecate the Field Layout module
Comment #57
catchComment #58
bnjmnmIn the ~5 years that have passed since I first created the Field Layout contrib version, I have less overall bandwidth to be an adequate maintainer, so I'm happy to add some additional ones.
Comment #59
maxilein commentedWhat is the recommended alternative to this module?
Comment #60
andypostThere's no alternative yet, so I'm willing to maintain it in contrib
Comment #61
maxilein commentedthank you.
Comment #62
quietone commentedcatch asked in committer slack if there was anything else to do here. That caused us, include @Gábor Hojtsy, to take a second look here. And there is nothing more to do. There is clear agreement on deprecating field_layout.
Thanks everyone for resolving this.
The work to implement this starts in #3517712: [meta] Tasks to deprecate the Field Layout module.
Comment #64
quietone commentedChanging to latest version when this was closed.
Comment #65
quietone commentedComment #66
quietone commented