Access drupal 7 field collection value in node tpl

Access drupal 7 field collection value in node tpl.php file
ex.(node--contenttypename.tpl.php)
We have created a bundle in content type
(admin->structure->content Type)
field_scholarship_recipient_imag  with property fieldcollection
then we have some values in our
field collection section
(admin->structure->field Collection-> field_scholarship_recipient_imag)
field_recipient_image (Unlimited option) and field_recipient_image_blurb .
<?php
 foreach ($node->field_scholarship_recipient_imag['und'] as $entity_id) {
 $value = $entity_id['value'];
 $entity = entity_load('field_collection_item', array($entity_id['value']));
 $image_url = image_style_url('medium',$entity[$value]->field_recipient_image['und'][0]['uri']);
 $recipient_image_blurb_value = $entity[$value]->field_recipient_image_blurb['und'][0]['value'];
 ?>
 <li>
    <a class="thumb" name="leaf" href="<?php echo $image_url?>" title="Title #0">
     <img  style="width: 100px; height: 100px;" src="<?php echo $image_url ?>" alt="<?php echo $recipient_image_blurb_value; ?>" />
    </a>
    <div class="image-desc"><?php echo $recipient_image_blurb_value; ?></div>

<?php }?>
Advertisements