I'll preface this by saying I'm not sure this suggestion fits within the module, but it seemed like a reasonable option after testing a few cases and also reviewing the issue regarding nested field collections.

I understand that the theme_ functions exist to allow for overrides of results, however I found the way that nested field collection tables are implemented did not work as I would have expected.

As a test, I created my own view mode for a field collection to be nested within another field collection, expecting that my view mode would be displayed. Rather, the way 7.x-1.x-dev works is the embedded field collection is always shown as a table (unless there's something I'm missing?).

As I mentioned, I know I could use the theme_ functions, but this just doesn't seem very intuitive. I would think if I can select a "Rendered entity" format and select my custom view mode, it should work in Field Collection Table as I'd expect.

So I modified the module to allow for a new view mode called "Nested field collection table" that can be used if required, otherwise the field renders based on the selected view mode.

Granted, this approach may have some unintended consequences -- I don't know all the methods that the module is using to render results, and maybe there is a better way to handle this.

However, I wanted to put this patch out there for others to review and provide feedback. Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ron_s’s picture

Status: Active » Needs review
FileSize
1.76 KB

The patch is attached for review. I'd appreciate any feedback, thanks.

ron_s’s picture

The previous patch no longer works with the current dev branch and release. A re-rolled version is attached. Thanks.