There's an issue (with a patch) for Field Collection to completely hide empty collections. Since this module replaces the field collection widget, it needs its own patch to achieve this too.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | hide_empty_collections-1653626-19.patch | 2.07 KB | nevergone |
| #18 | hide_empty_collections-1653626-18.patch | 2.16 KB | gambry |
| #12 | hide_empty_collections-1653626-12.patch | 2.15 KB | Anonymous (not verified) |
Comments
Comment #1
Anonymous (not verified) commentedHere's the same code from the latest patch at the above issue applied to this module. Works for me (i.e. hides the collection label completely when the collection is empty).
Comment #2
glynster commentedBWPanda I was wondering if you might be able to help me in my situation. I created a new case but have not had any feedback. Here it is for your reference: http://drupal.org/node/1708258
When I choose the "Table of field collection items" for the field I have the issue above in that the thead with labels is suddenly printed inside the tbody thus printing the labels when the table should actually not print. I applied your patch in the hope that this may have fixed the issue - but no luck.
Any ideas or solutions would be very helpful.
Comment #3
MichaelP commentedThere was a typo in the patch ([elements] -> [element])
Rerolled.
Works ok for me, thanks @BWPanda
Comment #4
glynster commentedOK makes all the difference.
I now see the option inside views and once applied it works like a charm.
Thanks for the re-roll.
Comment #5
Anonymous (not verified) commentedThanks for spotting that MichaelP!
Comment #6
rjdjohnston commentedWorks beautifully! +1 for adding to core module.
Comment #7
nancydruPatch failed and called out trailing whitespace.
Comment #8
altcom_alan commentedPatch in #3 worked for me on 7.x-1.0-beta1.
I've added the hide collection setting to the summary info.
Comment #9
robinmarshall commentedThanks, that works perfectly for me, look forward to seeing this in the release.
Comment #10
off commentedPatches dont work for me.. I see empty collections titles.
Trying apply to stable release..
Comment #11
caw67 commentedpatch works
please commit!
Comment #12
Anonymous (not verified) commentedHere's an updated patch for the latest dev version.
Comment #13
glynster commentedThanks @BWPanda any chance we can get this committed?
Comment #14
Anonymous (not verified) commentedA good first step would be testing and marking this issue as RTBC :)
Comment #15
glynster commentedI committed this patch and works again just like before! RTBC
Comment #16
Anonymous (not verified) commentedComment #17
gambryJust to re-confirm: patch works perfectly and it would be good to have this pushed on next version, as having the label on the page when there are no items is quite annoying :( .
Thanks!
Comment #18
gambryActually to be correct a hook_field_formatter_view should always return the $element array(), in this case as empty.
The patch just swaps:
with
Comment #19
nevergonePatch re-rolled and tested: works well!
Comment #21
kevineinarsson commented