Conditional code in preprocess_page function?
I think this will work for you. Note:


It doesn't check the node type.
It adds the variable has_background_image on any page that has $vars['node'] available in hook_preprocess_page, and only on those pages.
$has_background_image will be true if the field isn't empty (that's the only check).


.

function MYMODULE_preprocess_page(&amp;$vars) {

  $field_name = 'field_background_image';

  if (!empty($vars['node'])) {

    $node = $vars['node'];
    $items = field_get_items('node', $node, $field_name);

    $vars['has_background_image'] = $items ? TRUE : FALSE;
  }
}