I need to create a table style view that has separate columns for each field of each instance (delta) of a field collection. I was able to implement this by copying from the references module. See http://drupalcode.org/project/references.git/blob/refs/heads/7.x-2.x:/vi... for an example.
I haven't written a patch because I couldn't figure out how to get views to load the file for my new handler, so I just stuck it directly in the existing field_collection.views.inc file. I might try again later and submit a patch.
My use case is this: I am setting up a sports league management system and I have a content type of match. I have a field collection of team and the team has team name, score and a checkbox for if the team forfeited or not. The field collection has a max delta of 2 so basically I would have a relationship for delta 1 called "home team" and a relationship for delta 2 called "away team".
Comment | File | Size | Author |
---|---|---|---|
#5 | field_collection-views_relationship_delta-1208346-5.patch | 3.38 KB | 13rac1 |
#3 | 1208346-field_collection_views_relation_delta.patch | 2.78 KB | mstrelan |
Comments
Comment #1
Murzsubscribe
Comment #2
mstrelan CreditAttribution: mstrelan commentedDammit I wish I wrote a patch because now I can't figure out how to get this to work.
Comment #3
mstrelan CreditAttribution: mstrelan commentedHere we go. Might need a cache flush or two, or maybe even forcing views to flush it's cache too.
Comment #5
13rac1 CreditAttribution: 13rac1 commentedThis issue was created before mine, #1332452: Add result Delta to Views Relationship Handler. I set mine issue to Duplicate.
Comment #6
dawehnerLooks pretty fine
Comment #7
Zeotyn CreditAttribution: Zeotyn commentedworks wonderfull!
Comment #8
p4trizio CreditAttribution: p4trizio commentedWorks
Comment #9
tim.plunkettAwesome, thanks!
http://drupalcode.org/project/field_collection.git/commit/3891155
Comment #10
13rac1 CreditAttribution: 13rac1 commentedCool thanks! I wish --author was used more often on d.o.
Comment #11
tim.plunkettGit doesn't understand multiple authors, unfortunately. But I do try to use it when there is a clear single author.
Comment #12
charlie-s CreditAttribution: charlie-s commentedI patched up -- does this provide sorting by delta? I can't seem to get that working.
Comment #14
Spleshka@mstrelan,
Thank you so much! I saved a lot of time for coding same relationship handler for Views :)