I use a lot of nested Field Collections with cardinality set to unlimited (which works great!), but it would be awesome to have the ability to collapse each instance of the field collection when using the embedded layout.
Collapsing would allow for easier drag-and-drop reordering and make the editing panel a lot easier to visually process (being able to "close up" the field collections not being edited at that moment would certainly cut down on confusion).
I guess a side request of this feature would be the ability of the field collection's label to take on the name of the value of the first field, so when collapsed, it would be visually distinct from other instances of the collapsed field collections. However, I'd be more than happy with just "Field Collection 1, Field Collection 2."
Comment | File | Size | Author |
---|---|---|---|
#15 | field-collection-collapsable-fieldset-hack.png | 22.93 KB | aimeerae |
#13 | inline_entity.gif | 8.68 KB | jfrederick |
Comments
Comment #1
hixster CreditAttribution: hixster commentedany progress on this , I just stumbled across a need for this too
Comment #2
jpcurley25 CreditAttribution: jpcurley25 commentedAgreed... complex content types with many field collections is very hard to follow making it easy to mistakenly enter data incorrectly.
Comment #3
j4 CreditAttribution: j4 commentedWould also love to have this facility
Thanks
Jaya
Comment #4
node9 CreditAttribution: node9 commented+1
Where do we start?
Comment #5
hbalagtas CreditAttribution: hbalagtas commentedAnother +1
I have a fairly complex nested field and this feature would help so much.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedlikewise (+1)
I'll give it a shot whenever I find the time.
Comment #7
idflood CreditAttribution: idflood commentedI need this for a project too. I will probably go for a custom js but here are some remarks:
Any other idea of how to handle the flexibility needed for a complete solution?
Comment #8
andrew.croce CreditAttribution: andrew.croce commentedI'd like to add my support for this feature request. Field Collections is a fantastic module, but it can become rather unwieldy when there are many nested fields.
Thanks
Comment #9
dman CreditAttribution: dman commentedInteresting idea.
With the items becoming themable #1157794: Move markup to template files and improve theming in new 2.x branch you may be in a good position to override the rendering as needed.
But I would suggest waiting for that patch to land before trying to develop this just yet.
I can see a number of ways that the fieldgroup options and style could be re-purposed to this. (imagine accordion on it)
Comment #10
andrew.croce CreditAttribution: andrew.croce commentedIndeed, I have discovered that using fieldgroups works perfectly for this. You can quite easily create nested accordion groups/items, and out your field collections in there. Thanks for the suggestion dman.
Comment #11
zulfierken CreditAttribution: zulfierken commentedAny update?
Comment #12
aendra CreditAttribution: aendra commented+1 on what dman said in #9 and andrew.croce said in #10 -- I'm using Field Groups to accomplish this and they work great.
While it *would* be nice to have folding/accordioning/etc. as a native feature in Field Collections, I can see this only happening if the community steps up to do it -- which, given as there's a fairly robust workaround (And much more pressing bugs in the Field Collection issue queue), I'm not exactly holding my breath.
(That said, definitely willing to review/test any patches someone releases on this issue.)
Comment #13
jfrederick CreditAttribution: jfrederick commentedI understand this issue is a low priority, but I want to mention that Inline Entity Form has a UI I believe would work excellently for Field Collection. Each field collection could be, by default, collapsed into one table row. When you click Edit on a table row, it would then expand. I believe IEF uses Ajax to then load the edit form, but I think Ajax or simple JS hiding/showing would be fine.
Comment #14
dman CreditAttribution: dman commentedI like the look of #13 as a UI alternative
Comment #15
aimeeraeEDIT - just saw #9 and they also had this idea and I jumped to the end (sorry :-/). It is a functional workaround while a more robust solution is set up. :-)
Thank you jfrederick! RE #13 - it is a great idea! I'm using inline entity form on other parts of the site but also using field collections (different use cases). Since I don't have much background extending field collections / forms, I'm not sure if there are gotchas in that method. Any feelings from the maintainers on this?
This issue thread got me thinking (thank you!). Just for giggles, check out this collapsible fieldset hack. Using an accordion grouping helps shrink the complex field collection sections I use for generic article and page types. It did the job of consolidating the sections into more manageable sections. I'm not yet sure what it may do to my other displays, but it helps deal with the ability to rearrange the unlimited field collections on the node form.
I even left one of the fields out so people have visibility into the fieldset contents. :-)
Comment #16
andypostThere's a project application #2012796: [D7] Field Collection Fieldset
Suppose collapsible widget could be implemented in the proposed module as addition to formatter
Comment #17
zestagio CreditAttribution: zestagio commented#2012796: [D7] Field Collection Fieldset
Hi, I wrote a module that implements formatter to display the Field Collections as a fieldset. I plan to implement the widget in the future
Comment #18
zestagio CreditAttribution: zestagio commentedI finished a module Field Collection Fieldset and now it provides a widget "Fieldset" for field_collection fields.
Comment #19
thirdboxcar CreditAttribution: thirdboxcar commented@zestiago, I finally hopped back onto this thread after starting it two years ago...your widget is exactly what I wanted! Thank you!!
Comment #20
mxhIsnt it possible to use the Field Group module for this case?
Comment #21
kopeboy CreditAttribution: kopeboy commentedThe problem is that the embedded field collection already IS a fieldset.
So for example if I want to use the (field group's) accordions I will have the field collection nested with double title :(
The field collection fieldset module currently has some bugs.. the relevant one being it cannot start the fieldset as collapsed :(
Comment #22
joshuasosa CreditAttribution: joshuasosa commentedI just ran into this issue, and #18 works perfectly for my needs! Thanks so much zestagio!
Comment #23
Watergate CreditAttribution: Watergate at Sicse commentedThanks zestagio, works perfectly!