php - Drupal entity with field collections not saving value to a variable -
i have field collections within entity , i'm trying theme values having hard time saving of values variables. in code below, trying print value 'field_area_headline'
getting 'undefined index' notice in browser. i've included image of browser have dpm-'d variables clue know for.
what doing wrong? in advance!
<?php foreach($variables['field_focusareas'] $delta => $item) : ?> <?php $focus_area_node = $item['entity']; ?> <?php foreach($focus_area_node->field_area $focus_delta => $area) : ?> <!-- <?php dpm($area); ?> --> <?php $focus_area = entity_load('field_collection_item', array($area[0]['value'])); dpm($focus_area);?> <?php $headline = $focus_area['field_area_headline'][language_none][0]['safe_value']; ?> <h3><?php print $headline; ?> </h3> <span></span> <?php endforeach; ?> <?php endforeach; ?>
$focus_area
object, not array. need retrieve object property - $headline = $focus_area->field_area_headline[language_none][0]['safe_value'];
Comments
Post a Comment