Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As far as I can see the entity_id field is not available as a view field. I would like to use the host entity as a filter for my listing of field collection items.
I have a bit of experience in writing the views integration mapping stuff, so I guess it could be fairly easy to provide views integration for the entity_id field as well. Can someone give a hint, how exactly this could be done?
Thanks,
Walter
Comments
Comment #1
valderama CreditAttribution: valderama commentedups, orignially posted the issue in the wrong queue
Comment #2
AndrzejG CreditAttribution: AndrzejG commentedDid You try the EVA (http://drupal.org/project/eva)? I mean EVA holds only Collected fields and is attached to the host entity as a bundle.
Comment #3
tim.plunkettPostponed on #1047784: [Meta] Views Integration for field collection.
Comment #4
h.arefmanesh CreditAttribution: h.arefmanesh commentedI also want to filter field collection item by host entity id.
can anyone help me Please?
Comment #5
charlie-s CreditAttribution: charlie-s commentedSame issue. Sub.
Comment #6
charlie-s CreditAttribution: charlie-s commentedYou can include the field_collection ID as an excluded field and then use Views PHP to print a PHP field with something like this:
Now $host_entity is your node or whatever the field_collection is attached to. Thus $host_entity->nid would be your node id.
Comment #7
zunaeid CreditAttribution: zunaeid commentedThis is working for me
Comment #8
jmuzz CreditAttribution: jmuzz commentedThe suggested solutions should work as far as I know.