Closed (outdated)
Project:
Drupal core
Version:
8.7.x-dev
Component:
entity system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
16 May 2017 at 00:43 UTC
Updated:
19 Nov 2018 at 20:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tim.plunkettComment #3
tim.plunkettComment #4
jonathanshawThanks Tim! Obviously a huge win for sitebuilders here. Goodbye to a whole class of clunky contrib modules to achieve a very common use case.
Comment #5
swentel commentedAwesome. Tested it and works like a charm!
Only quickly scanned the code, looks fine to me.
nitpick: missing 'm' in fro
Don't want to set it to needs work for now for missing things (e.g. config dependencies, post update hook to update entity displays) so more people can look at it.
Comment #6
dawehnerJust some quick comments ...
These methods names are weird ... given that one returns an object and the other one an array of configuration.
I'm wondering whether we could pass in the current rendered entity as context. With that we would have to rely less on block runtime contexts
Comment #7
groovedork commentedThis is great, but as a sitebuilder I would prefer a solution described here, as it has a number of advantages:
- It offers a clean workaround for the problem that the title is not a field.
- It allows for fields to be placed in any of the theme's regions. This would be extremely valuable, and would allow much more flexibilty than this solution offers.
Comment #8
jonathanshaw#7 no reason not to have both? They're not way duplicates AFAIK.
Comment #9
tim.plunkettThat other issue is an interesting idea, but as jonathanshaw points out it is not conflicting with this one.
Comment #10
groovedork commentedIt may not conflict technically, but they do overlap functionally. Both systems could be used to place blocks in between fields.
Energy to work on Drupal may not be infinite. If energy could be redirected, then I propose to redirect it towards the solution that solves more problems (title does not behave like a field) and offers greater flexibility (mix blocks and fields into any region).
This solution, while wonderful in its own right, could lead to lethargy and slowdown in the development of a solution that I believe would be better, and also covers this use case.
Comment #11
tim.plunkettPlease comment on the other issue to encourage others to work on it, and stop derailing my efforts here. Thanks!
Comment #12
groovedork commentedOk, sorry.
Comment #13
tim.plunkett#5
The typo was "for" :)
What do you mean config dependencies?
Adding update path to IS
#6
1) Agreed. Renamed to match the corresponding method, this is now getBlockComponents()
2) We can pass that in as an available context, but we still need to get the mappings for runtime.
Comment #15
tim.plunkettComment #17
Bojhan commentedWhat? :D
What is a block field?
Comment #18
manuel garcia commentedTotally love this idea :)
This should fix the failing test.
Comment #20
manuel garcia commentedOK thats a new failing test, but I've just run it locally and it passes... random failure?
Comment #21
swentel commented@tim.plunkett
Nevermind that one, completely wrong in my mind :)
Comment #22
swentel commented@tim.plunkett actually, I do remember again re: (config) dependencies. If you add a block in the entity display, a dependency should be added (module I guess) depending on the module that provides that plugin ? Probably in EntityDisplayBase::calculateDependencies ?
Comment #24
tim.plunkettNot sure that we need this still with the Layout Builder work, but here's a reroll anyway.
Comment #26
tim.plunkettEven more changes to reroll for, from yesterday!
Comment #27
Bojhan commentedI am going to remove the "Needs usability review" tag.
This looks like a fine direction. I am a bit worried that with "Add block field" we leave out the ability to add "non-block" fields, and that no one knows what a "block" field is. But thats purely a labeling thing.
For the form itself, can you add screenshot of various block configs and how they look embedded in the table?
Comment #28
tim.plunkettHere's the Recent Content, Branding, and Menu (initial state and open details) blocks.
Comment #29
jian he commentedThe patch #26 works great. My question is: Can we display the block title as the field label if "Display title" enabled in block setting?
Comment #30
andypostSome blocks can't be placed - main content, site branding
Comment #31
andypostMakes sense to have separate issue to discus UX visibility conditions for blocks
Comment #32
andypost@tim.plunkett btw maybe do abstraction in #1875974: Abstract 'component type' specific code out of EntityDisplay
They looks like duplicate of "components"
basically components needs derivative types - fields, sections, blocks, extra fields
Comment #33
jonathanshawFollowing up the UX comments in #27
Perhaps it should be "Add block" not "Add block field".
Other contrib may also want to add things here, and field group already does. But this is the first time in core so there's no pre-established pattern. Perhaps rather than having a different button for each thing that can be added, the pattern should be a dropbutton here condensing them.
I'm not sure whether this should be done as part of this issue or separate, and if separate whether it should follow after this issue (abstracting out the add functionality) or precede this issue.
Eventually after #1875974: Abstract 'component type' specific code out of EntityDisplay the buttons could be generated dynamically based on component plugin metadata, but the UX pattern can be established independent of this.
Comment #34
andypost@jonathanshaw it could be done as selection of type in modalif there will be more then 10 types, but not clear how this action link with dropdown may look like
Comment #35
jian he commentedComment #36
jian he commentedRerolled.
Comment #40
tim.plunkettFixed
Comment #42
tedbowWhen this patch is used with Layout builder enabled the field blocks are available which leads to weird behaviour and UX.
I tested it on user manage display admin/config/people/accounts/display/default. I did a clean install and then enabled layout builder
but sense all the field blocks show up regardless of whether they view configurable which kind makes that field property useless. Because it doesn't mean what it use to.
the label is exactly the same
but then they have pretty much have the same settings just in a different form
Should the layout builder itself exclude field blocks from this list?
Comment #43
tim.plunkettI'm not even sure we want to do this still. Don't ask me why I bothered to reroll it...
Comment #44
swentel commentedYeah, I would just close this too :)
Comment #45
tedbowOk closing as outdated because you could now just use Layout Builder to get this functionality and more