I needed to set up a custom "view mode" for one of my field collections, this was possible in the current entity display settings page. Unfortunately there was no way to link up the field collection view mode and the field formatter on the node display settings.

I wrote a small module which creates a new field formatter for Field Collection fields, and pulls in all of the available view modes from the field collection settings.

I believe it would be beneficial to merge this module in with the field collection module itself. In the mean time this module is tested and working.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

stevector’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Needs review
FileSize
2.28 KB

Here's a patch to the module.

stevector’s picture

That patch didn't include any changes to field_collection_field_formatter_settings_summary()

arbel’s picture

+1 to this, tried the module and works great, but I too feel like it should be part of field collection

JohnAlbin’s picture

Yeah, I was wondering how the field_collection view mode hooked up to the view mode used by the parent entity.

JohnAlbin’s picture

Status: Needs review » Reviewed & tested by the community

I tested this patch by applying it, adding a new "teaser" view mode using the Entity view modes module and configuring a different display for the field collection's "teaser" view mode.

Then I set the collection field on my node was configured "full display" view mode and confirmed it looked as it always did. Then I set the collection field on my node to use the "teaser" view mode and confirmed the field's display was using the "teaser" view mode's settings for the fields in the collection.

Sweet!

tim.plunkett’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.