Problem/Motivation
There are some related issues (I found these: #2893737: Move meta details element from NodeForm to ContentEntityForm, #2893740: Allow the sidebar for the node form to be used on other entity forms as well) that suggest that the entity_meta sidebar on the node add/edit form should be re-usable.
Proposed resolution
Provide a new render element 'Accordion' that can replace node entity_meta and can be re-used elsewhere.
@todo
Remaining tasks
@todo
User interface changes
@todo
Expected: nothing.
API changes
New render element.
Data model changes
@todo
Release notes snippet
@todo
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | reroll_diff_17-23.txt | 2.43 KB | pooja saraah |
| #23 | 3056089-23.patch | 7.81 KB | pooja saraah |
| #17 | interdiff_14-17.txt | 1.34 KB | komalk |
| #17 | 3056089-17.patch | 7.19 KB | komalk |
| #14 | 3056089-14.patch | 6.58 KB | komalk |
Comments
Comment #2
volkerk commentedWorking on it.
Comment #3
volkerk commentedFirst throw at adding a accordion render element.
I used the same approach as vertical_tabs does, but was considering adding process and pre-render from RenderElement class directly, maybe someone could shed a light why it is done using that intermediary details element?
We should define which behaviors are supported, think a default open item or
controlled accordion (opening an item will close all the others).
Also handling open / closed state is not implemented yet.
Some feedback would be much appreciated.
Comment #5
andrewmacpherson commentedFirst, you're going to have to explain what "accordion list" means. I've encountered the word "accordion" used many designers and developers, who understood it to mean different things. In my experience, I always have to ask for clarification about the intended behaviour. What special difference does the "list" part make?
Adding a new render element probably doesn't qualify as minor.
Comment #6
andrewmacpherson commentedThis is out of scope, surely? The issue summary says the scope is to add a new render element type, but this changes an actual form.
The new render element type is called "accordion" here, not accordion list.
Comment #7
andrewmacpherson commentedComment #8
lauriiiI agree with @andrewmacpherson that it should be called accordion, not accordion list.
Comment #9
lauriii@andrewmacpherson Usually when we create new render elements or theme hooks its great if we can add at least one usage of that component into core. This way we can ensure that it at least works in the use case of node sidebar. Given that, in my opinion, making node form sidebar use accordion would be nice to include in the scope of this issue.
Comment #10
andrewmacpherson commentedRe. #8;
I didn't actually say what it should be called. Rather, I was asking for clarification about what both terms mean.
I ask because in my experience accordion is used to mean various different things, and there's confusion around the expected usage and behaviour. When I'm told there's going to be an accordion, I always have to ask what sort of accordion they mean. Here are some of the assumptions that I've encountered before:
So what is the new render element being proposed? What does it mean, and how does it behave?
The issue summary says it would replace the node entity meta, which is currently a details element nested inside a vertical tabs container. The Seven theme alters both of these to be plain containers. Is this proposing to remove vertical tabs fron the node module, or is it just for Seven's form alter?
Comment #11
AmandeepKaur commentedComment #14
komalk commentedRerolled patch to 9.1.x.
Comment #16
komalk commentedComment #17
komalk commentedFixing test cases!
Comment #22
greg boggsI believe, for this patch to be tested, support for this render element needs to be added to the field group module. This is the issue for that: https://www.drupal.org/project/field_group/issues/3244774, it looks like some more work is needed there to make this happen.
Comment #23
pooja saraah commentedFixed failed commands on #17
Attached patch against Drupal 9.5.x
Comment #25
smustgrave commentedThis issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge require as a guide.
Tagging for IS updates as there are some todo's to fill in.
Also tagging for tests.
Could this be a duplicate of #3062136: Create a details/summary FieldFormatter plugin for text fields. though?
Comment #26
smustgrave commented