Created
November 1, 2012 09:15
-
-
Save johnmcc/3992655 to your computer and use it in GitHub Desktop.
Loading field collections as entities from Drupal templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foreach($content['field_my_field_collection']['#items'] as $entity_uri) { | |
$item = entity_load('field_collection_item', $entity_uri); | |
foreach ($item as $entity_obj) { | |
dpm($entity_obj->field_my_individual_field); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change 'field_my_field_collection' to the name of your field. Leave 'field_collection_item' as is.