[support] The best place to edit the node title?

Laura Scott laura at pingv.com
Fri Sep 14 16:10:04 UTC 2007


On Sep 14, 2007, at 8:56 AM, Augustin (Beginner) wrote:

> On Thursday 13 September 2007 19:49, Earnie Boyd wrote:
>> Quoting "Augustin (Beginner)" <drupal.beginner at wechange.org>:
>>> <?php if ($node->title_prepend): print '<span class="node-label">'.
>>> $node->title_prepend .' </span>'; endif; ?>
>>
>> Don't you need to protect against the non-existence of
>> $node->title_prepend or is it guaranteed to be present at this point?
>
> You are right. I am supposed to use isset().
>
>> <code>
>> <?php if (isset($node->title_prepend)): print '<span class="node- 
>> label">'.
>> $node->title_prepend .' </span>'; endif; ?>
>> </code>
>>
>> And you want to prettify this code.

Here's a simpler solution (I think) but maybe this approach has been  
deprecated as it's something I used back in the 4.6 days....

<?php print $node->type ?>

A linked node title then would be something like:

<h2 class="title"><a href="<?php print $node_url ?>" title="<?php  
print $title ?>"><?php print $node->type ?>: <?php print $title ?></ 
a></h2>

Laura



More information about the support mailing list