Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to set new variable
$vars['author_uid'] = $message->author->uid;
in
function template_preprocess_privatemsg_view(&$vars)
without hacking the module.
How can I override function template_preprocess_privatemsg_view(&$vars)
?
Comments
Comment #1
miljats CreditAttribution: miljats commentedComment #2
cmonnow CreditAttribution: cmonnow commentedHi,
I believe all you have to do is modify your template.php file in the root of your theme/sub-theme folder to override (or in your case, add new variables to)
function template_preprocess_privatemsg_view(&$vars)
.In your simple case you would add the following function to your template.php file:
where YOUR_THEME_NAME is the name of your (sub)-theme.
Comment #3
ivnish CreditAttribution: ivnish commented