3

I'm trying to create a view of flagged field collections, filtered by the currently viewed node. I don't seem to be able to add either a relationship nor contextual filter to limit the field collections to those belonging to a single node.

Has anyone managed to do something similar?

5
  • what contextual filters have you used? Commented Jan 17, 2013 at 7:10
  • None, as there are none that refer back to the node on which the field collection was created. Commented Jan 18, 2013 at 1:32
  • I am sure you would have tried this but just in case. have you tried putting the node id as the contextual filter. And I presume you are creating a view of the type node with fields. Commented Jan 18, 2013 at 4:28
  • Thanks @MohammedShameem but that's what I'm asking about - node id is not available as a contextual filter. As I said in the question, it is a view of flagged field collections, not nodes. Commented Jan 23, 2013 at 0:10
  • could you let me know the modules you have used and a small description of how you are trying to do it. Commented Jan 23, 2013 at 3:55

1 Answer 1

12
+50

Please try the following.

  1. Add a relationship "Field collection item: Entity with the {Field Collection name (field_collection_machine_name)}" You should change the one in {} with your filed.
  2. Now you should get the content nid in the contextual filter which could be used to filter using the node id.
  3. To limit it to show only the flagged fields you should select the "Flags: Field collection item flag" from the relationships and select the flag you want to filter it by and select if it should be for the current user or all users
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.