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

miljats’s picture

Issue summary: View changes
cmonnow’s picture

Hi,

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:

function YOUR_THEME_NAME_preprocess_privatemsg_view(&$vars) {
  $message = $vars['message'];
  $vars['author_uid'] = $message->author->uid;
}

where YOUR_THEME_NAME is the name of your (sub)-theme.

ivnish’s picture

Status: Active » Closed (outdated)