Extracting a specific data part of a Field Collection Item I've been playing around with this for the better part of a few days now with no luck. Here is my Collection data:

Collection name: field_video_collection

Within the collection there is a field called: field_video_file_col 

My fields print fine in my custom field-collection-item--field_video_collection.tpl.php template, I followed the documentation according to this issue to get my template name and I simply print the fields as &lt;?php print render($content['field_video_file_col']); ?&gt; etc... within that template. 

Now for the fun part, I'd like to extract the fid for each field_video_file_col item in the collection in any given node and render it as a printed variable. I followed the answer in this question here on Stack but it does not seem to work for me. if I do:

print '&lt;pre&gt;';
var_dump(get_defined_vars());
print '&lt;/pre&gt;';


I see I have this as part of the data available to me for field_video_file_col

["field_video_file_col"]=&gt;
          array(1) {
            ["und"]=&gt;
            array(1) {
              [0]=&gt;
              array(12) {
                ["fid"]=&gt;
                string(3) "888"


So it looks to me that the FID is 888 in this case and I want to render that in my template. My node preprocess function is as such:

function MYTHEME_preprocess_node(&amp;$vars, $hook) {

    $entity_type = 'field_collection_item';
    $bundle_name = 'field_field_video_collection'; // Field name the collection is attached to
    $field_name = 'field_video_file_col'; // Field name within the field collection
    $video_file_fid = field_info_instance($entity_type, $field_name, $bundle_name);
    if ($video_file_fid) {
      $my_fid = $video_file_fid['fid'];
    }
}


The end result needed is that I need to render the variable in my field-collection-item--field_video_collection.tpl.php template as:

&lt;?php print $video_file_fid; ?&gt;


... but this does not seem to work.  I've searched all over and tried many different incarnations of this code and combinations but still no joy.
I use Entity API when work with Field Collection Items. See: Programmatically create and update field collection with Entity API 

To work with field collections can do smth like this:

// Wrap node with Entity API
$node_wrapper = entity_metadata_wrapper('node', $node);
// Get the first item from the muli-value field collection
$raw_collection = $node_wrapper-&gt;field_video_collection[0]-&gt;value();
// Wrap it with Entity API
$collection = entity_metadata_wrapper('field_collection_item', $raw_collection);
//dsm the old value
debug($collection-&gt;field_video_file_col-&gt;value());


If you already know your field_collection id you can just do: 

$collection = entity_metadata_wrapper('field_collection_item', $fid);
//dsm the old value
debug($collection-&gt;field_video_file_col-&gt;value());


UPDATE:

use the code above in MYTHEME_preprocess_node

UPDATE 2:

So in your case it will be:

function MYTHEME_preprocess_node(&amp;$vars, $hook) {
  if (empty($vars['nid'])) {
    return;
  }
  // Wrap node with Entity API
  $node_wrapper = entity_metadata_wrapper('node', $vars['nid']);
  // Get the first item from the muli-value field collection
  $raw_collection = $node_wrapper-&gt;field_video_collection[0]-&gt;value();
  // Wrap field collection with Entity API
  $collection = entity_metadata_wrapper('field_collection_item', $raw_collection);
  // print value
  $fid = $collection-&gt;field_video_file_col-&gt;value();
  debug($fid);
}


Also you can find answer at Understanding Field Collection Values