How do I retrieve node data for a referenced node in a template file?
it seems you need to know value of node which is referring the current node.
I am assuming machine name for the refernce field you have on event content type as "field_event_gallery"

In your custom module or template.php
// function to get backrefernce value.

function mymodulename_get_back_refernce_value($current_nid) {
  $nids = array();
  $results = db_select('field_data_field_event_gallery','n')
            -&gt;fields('n',array('entity_id'))
            -&gt;condition('field_event_gallery_nid',$current_nid)
            -&gt;execute()
            -&gt;fetchAll();
  if(is_array($results) &amp;&amp; count($results) &gt; 0) {
    foreach($results as $result) {
      $nids[] = $result-&gt;entity_id
    }
  }
  return $nids;
}


Now in your theme template.php use template_preprocess_node(),something like below

function MYTHEME_preprocess_node(&amp;$variables) {
  $node = $variables['node'];
  if ($node-&gt;type == 'gallery') {
    //get referring nids
    $referring_nids = mymodulename_get_back_refernce_value($variables['node']-&gt;nid);
   if(count($referring_nids) &gt; 0) {
     foreach($referring_nids as $referring_nid) {
       $referring_node = node_load($referring_nid);
       $variables['parent_event_link'][$referring_nid] = l(t('View parent event: @event_title', array('@event_title' =&gt; $referring_node-&gt;title)), 'node/' . $referring_nid);
   }
  }
}


finally in your template loop through $variables['parent_event_link'] and print it.

My codes are not tested, you have to debug to make them workign for you