How to create a link on a field in a custom template file
You will want to use a preprocess function in your theme's template.php file, so that you can manipulate the element's attributes before it is rendered.

For example, if you wanted to link a particular field to the node's page, you could implement template_preprocess_field() as such:

function THEMENAME_preprocess_field(&amp;$vars) {

  $items = $vars['items'];
  $node = $vars['element']['#object'];

  $path = 'node/'.$node-&gt;nid;

  if($vars['element']['#field_name'] == 'TARGET_FIELD_NAME'){
    foreach($vars['items'] as $key=&gt;$item){
      $vars['items'][$key]['#markup'] = l($item['#markup'], $path);
    }
  }
}


the l() function is a structured way to build a link within the Drupal API. In this example I have assumed that the field is only allowing plain text, but if your field allows HTML, you can pass extra variables to the l() function that will allow that.

You can access other node data in the $node variable I created, such as the node type, published status, etc. If you want to investigate all the variables available to you in this (or any) preprocess function or template, I would suggest installing the Devel module and printing out the variable you are interested in with the kpr() function. For example, you could add the following code to the preprocess function I created above:

kpr($vars);


and you would be able to see all of the data available for use in that function in an easy-to-read format.