hello g089h515r806 and thank you for your great job,
I want to list all field collection items that belong to one or more host entity Id in a view.
In fact I want to created a view and enable user to filter host entities.
let me explain more:
for example i have a content type with name 'factor' that use a field collection field with name 'factor_detail' for factor details,
i want to create a view that user can filter factors with factor title or other field that belong to 'factor' not in 'factor_detail' and the result show a list of 'factor_detail' that belong to one or more factors in one table with row number .
Can you please explain that how i can do that?

Comments

g089h515r806’s picture

Currently,this module does not support this feature.
This module only provide a formmatter for field collection using views, and add a little more views support for field collection.
Field collection does not support views very well, maybe it will add more views support.

marblegravy’s picture

h.arefmanesh, did you ever figure out a way to make this work? It's got to be possible somehow, even if this module doesn't support it?

anssary’s picture

did any one figure this out?
i wounder how can such an important module (http://drupal.org/project/field_collection_views) misses out such feature : (Host Entity ID) in (Contextual Filters)???

+1

g089h515r806’s picture

field_collection already provide this feature,

g089h515r806’s picture

field_collection already provide this feature,

SergeyR’s picture

sorry
but i cannot find it too (((
please advice

gargsuchi’s picture

Hi I was able to do this using the steps below:
1. create a view of type field collection
2. Add Relationship - Field collection item: Entity with the Photos (field_photos) (u will see something else instead of photos)
3. Add contextual filter - Content: Nid ((field_photos) Content: Nid for me)

and you are done.
Hope this helps.

h.arefmanesh’s picture

It's works for me.
I could solve my problem by using relationship.

gjones’s picture

Awesome thanks garguschi, I was having difficulty trying to figure that one out!

zcrow’s picture

Category: support » task

Thanks for that! I spent hours trying to figure it out.

I was missing a couple details from the above example so perhaps this might help others.

1. Install field collection views
2. clone it for your purposes
3. Add relationship = Field collection item: Entity with the field_collection_name
4. Add contextual filter = Content: NID; relationship = field_collection_name
5. under When the Filter is Not Available choose Provide default value = Content ID from URL

C-Logemann’s picture

Ok, the described solution seems to work with one field collection. But what about a view with field collections items from different fields all related to one host entity?
In my case I have a node type with more than one field collection nested. I choose different text fields to get them separated in rules for special reaction on the creation of this items. But they all have the same date field. Now my customer wishes a view where three of the field collection types are shown in one list ordered by the date field. This sounds easy but needs the a contextual filter by Host ID. This seems not to work if this is based on a relationship as described above. Or is it possible to get a kind of OR-contextual filter?
To use separate field collections fields in the node is very helpful in my case for special permissions in a complex workflow. I hope I didn't have to leave the views way with custom code for SQL Queries and so on.