Optionally add image/icon after node title based on boolean content type field? Using Drupal 7.10 with a Zen sub-theme.  I have a custom content type, say Product.  The products have titles such as "Wrench", "Hammer", "TV".  I want to designate certain products as being a recommended product by having a little star icon appear inline after the title.

So for example:

Wrench
Hammer *
TV
Scooter
Piano *


Whether the star appears or not should be based on a boolean field I added to the product content type.  I want the star to appear when viewing the node directly or when the node appears as part of a list in a view.

My thought was to put an if statement in the node template for my content type, e.g. node--product.tpl.php.  However, what has me stuck is that in Zen it appears, if you are viewing a node as a page then the title is rendered in the page template, and if you're not viewing the node as a page then the title is rendered in the node template.  I'm not sure how to reconcile this.  Furthermore, I'm not sure if my field variable would even be available directly from the page template.

UPDATE

It appears I can successfully create a boolean preprocess variable in the function mytheme_preprocess_page whose value is based on field from the node:

function mytheme_preprocess_page(&amp;$variables, $hook) {

  //$variables['sample_variable'] = t('Lorem ipsum.');

  if (isset($variables['node'])
      &amp;&amp; $variables['node']-&gt;type == 'mycontent_type') {

    if($variables['node']-&gt;field_is_recommended
       &amp;&amp; $variables['node']-&gt;field_is_recommended[LANGUAGE_NONE][0]['value'] == 1) {
      $variables['is_recommended'] = TRUE;
    }
    else {
      $variables['is_recommended'] = FALSE;
    }

  }
}


So now that I know this is possible, what's the best way for me to do this?
While this can be on in the page preprocess, and the node template, and probably several other places as well, I would discourage that. It is putting to much logic in the theme, that doesn't belong there. The main advantage of my solution is that the field can look right regardless of where you display it. On a page, in a block, in the header, or essentially anywhere that properly integrates with the Field API.

My solution is as follows

Add a text field, with the boolean Yes/No options

Implement two hooks, hook_field_formatter_info() and hook_field_formatter_view()

function product_field_formatter_info() {
  return array(
    'product_star' =&gt; array(
    'label' =&gt; t('Recommended product'),
    'field types' =&gt; array('text'),
  );
}

function project_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  if ($field['type'] == 'text' &amp;&amp; $display['type'] == 'product_star') {
    return array(0 =&gt; array('#markup' =&gt; '&lt;img src="star.png"&gt;'));
  }
}


Clear the cache

Go to the fields display settings, and set it to "Recommended product"

Profit!