Closed (works as designed)
Project:
Display Suite
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Jun 2012 at 00:02 UTC
Updated:
24 Aug 2012 at 14:27 UTC
I have a code field where I am doing something similar to the following:
return render(field_view_field('field_collection_item', $entity, 'field_cup'));
It works as I would expect when DS Extras Field Templates is disabled, but if I enable Field Templates and select a different template this one code field continues to render from the core template despite the fact that all other fields render correctly. Am I doing something incorrectly or is this a bug?
Comments
Comment #1
nicholas.alipaz commentedI have just tested against 7.x-2.x-dev since there did not seem to be any upgrades to run, only code changes, and the result is the same.
Comment #2
swentel commentedWell, the template for that field you're calling in the code field should be configured on the field collection, not where this field is rendered (I'm guessing it's a node content type).
Comment #3
nicholas.alipaz commentedI found my issue, I had not set the "Full Content" view mode to use a layout yet, so display suite settings were not being used.
Thanks for answering.
Comment #4
nicholas.alipaz commentedOkay, further investigation and I found it did not work as I thought it had. I then did some more testing and was able to determine that there is some cascading going on. If you have node that has a field_collection field in it then all the displays need to be set to use the Display suite for their default view mode as well.
What I had was
Node
-- field collection field 1
-- view mode: default - not using display suite and field collection field display set to full view mode
-- view mode: full - using display suite and field collection field display set to full view mode and the correct template
Field collection 1
-- field collection field 2
-- view mode: default - not using display suite and field collection field display set to full view mode
-- view mode: full - using display suite and field collection field display set to full view mode and the correct template
Field collection field 2
-- regular text field (field I was trying the render from code field)
-- view mode: default - using display suite but my code field is not set to be available in this display
-- view mode: full - my code field set to use the correct template
When I changed the Node view mode: default to use display suite (one column) the template for my field two field collections deeper started displaying with the correct template.
I am not sure if this is a bug or not, but perhaps it is just documentation? I am reopening for your review, but close if you feel it doesn't warrant any changes.
Comment #5
swentel commentedThis is by design. It's indeed some kind inception going on here :)
Added it on http://drupal.org/node/644662
Comment #6
radio_babylon commentedi have a similar problem, where i have a field collection with a display suite layout assigned... and i cannot get it to use the DS layout no matter what i do, whether when viewing it directly by going to its /field-collection/foo/(num) alias, or when rendering it from inside a node the collection is in.
i have applied the DS layout to ALL the collection's view modes, and to ALL the containing node's modes, and it just flat will not use DS.
am i doing something wrong? any insight you could provide would be much appreciated...
Comment #7
radio_babylon commentednever mind. note to self: always, always clear drupal's cache before wasting time troubleshooting. d'oh!