3

I created a Field Collection field for a content type. This FC has two fields inside: an image field where I can upload unlimited number of image; and the other one is the title field to be used as a caption for these images.

Now the problem arises when I try to view this content type through Views where I can not modify each FC field but the whole FC. For example, if I had a content type with an image and a title field in Views I could manipulate the image field controlling the image style, the linking if the image links to the file or nothing etc. But since I use FC I can not access the image field settings anymore through Views.

The reason I want to manipulate the FC image field is that I want to use Colorbox inside my image gallery. But first I want to link all these images shown through Views to the node of each image gallery and then I want it to be seen with Colorbox.

Note: I tried to use in the FC settings Output this field as a link but it links only from the title field of FC not from the image field and, as I explained above, I can't manipulate the image field to make it have these settings.

Can someone help me out with this problem? Thank you!

5

Did you try to ad a new view with "Show: Field Collection Item" and then, you need different relationships and contextual filters. My Field collection Item is called Gallery and Caption

I've got the following relationships (right column of the views):

  • "Field collection item: entity with the Gallery and Caption" (this one connects the field collection item with my contenttype gallery)
  • "(Field_gallery_and_caption) File Usage: File" "Field collection item: Gallery Image:fid"

And following Contextual Filters (also right column of the views):

  • (field_gallery_and_caption) Content: Nid
  • Field collection item: Gallery Image:fid

I'm not sure about the order of adjustment, you have to try a little bit. But through relationships and contextual filters, you can get new fields for the views. And while configuring the fields (left column of views), there appears a dropdown called "Relationship", try different settings here, it changes the result.

Not the most detailed help but try to change the settings and you gonna get a result...

  • Thank you for the explanation sinini, don't you worry it's helpful enough ;) – pandisvezia Jan 6 '13 at 16:10
  • saved few hours ! – JayKandari Aug 7 '14 at 5:57
2

Old question so maybe you couldn't do that but now you can:

  • Use the displays provided by Field Collection (Structure>Field Collections>Manage display). I used the token display for instance and put out the fields I didn' t want to show.
  • Go to your View, and for the configuration of the Field Collection you want to use, put Formatter to "Fields only" and then choose your view mode (as I said, I used Token)

And that's it! =)

0

A very easy way to limit amount of field-(collection)-items to show (and also skip some) is using the module Field multiple limit. From the modules description:

This is a simple module that provides settings to limit the number of values to display on fields with multiple values.

The module extends the field display settings for fields which permit multiple values. Site administrators can specify how many values to display for each display mode (e.g. teaser). Optionally, an off-set can be specified to skip some values.

The Drupal 7 version depends on Field formatter settings API module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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