How to add an icon before (or after) the node title if a field is filled?
I found your answer on drupal.org.

function mytheme_preprocess_page(&amp;$variables) {
  $titleFile = 'myicon.png';
  $titleImage = base_path() . path_to_theme() . "/images/titles/" . $titleFile;

  $newTitle = $variables['title'].' &lt;img alt="' . $variables['title'] .'" src="' . $titleImage.'" /&gt;';
  $variables['title'] = $newTitle;    
}