Edit Node Title in Template.php UPDATE: I know that I could accomplish this inside of a tpl.php file. But I would prefer to keep as much logic in the template.php file as possible, reserving tpl.php adjustments for markup. I have been informed that Drupal is NOT an MVC paradigm but an AOP, and I am trying to adapt to that as quickly as possible. But I feel that since I have already accomplished this IN the Template.php file that there is bound to be a 'Best Practices' way of doing this that I would like to adopt.

Currently, I have a node_field called field_unique_card. This is a Boolean field.
If field_unique_card == 1 then the title of the node needs to be something like this:

$title = '* ' . $title;


The way I am currently doing it is as follows:

UPDATE: I just remembered the better way of (expr1)?(expr2):(expr3); so I updated my preprocess function.

function theme_preprocess_node(&amp;$variables)
{
    ...
    $variables['title'] =  $variables['field_unique_card'][0]['value'] ? '*' . $variables['title'] : '';
}


I am wondering if this is 'Drupal Best Practices' or if there is a smarter way? I ask because this only affects the nodes when they are displayed as a field. But on every node display there is an additional output of the Node title that happens at the top of the page. I can't figure out how to make it so that the title shows the * there as well.

Any help would be greatly appreciated.
The easiest (and less expensive) way I see to do this is as follows (did not try this, but should work):


Copy node.tpl.php from the core node module (/modules/node) to your theme's folder (/sites/all/themes/).
Modify the code to display the desired title. By default the code to display the title is:

&lt;h2&lt;?php print $title_attributes; ?&gt;&gt;
  &lt;a href="&lt;?php print $node_url; ?&gt;"&gt;&lt;?php print $title; ?&gt;&lt;/a&gt;
&lt;/h2&gt;


can be changed to:

&lt;h2&lt;?php print $title_attributes; ?&gt;&gt;
  &lt;?php if($unique_card == 1) { ?&gt;
    &lt;a href="&lt;?php print $node_url; ?&gt;"&gt;&lt;?php print "*" . $title; ?&gt;&lt;/a&gt;
  &lt;?php } else { ?&gt;
    &lt;a href="&lt;?php print $node_url; ?&gt;"&gt;&lt;?php print $title; ?&gt;&lt;/a&gt;
  &lt;?php } ?&gt;
&lt;/h2&gt;


Note: I used the variable $unique_card because the comments from node.tpl.php mentions:


  Field variables: for each field instance attached to the node a corresponding
  variable is defined; for example, $node->body becomes $body. When needing to access a field's raw values, developers/themers are strongly encouraged to
  use these variables. Otherwise they will have to explicitly specify the
  desired field language; for example, $node->body['en'], thus overriding any
  language negotiation rule that was previously applied.