How can I set a variable based on the render element $vars[‘body’][‘#object’][‘vid’]?
The #object in the $build array is an object, therefor it's properties have to be referenced with an arrow, ->

$orig_vid = $build['body']['#object']-&gt;vid;
$build['body']['#object']-&gt;orig_val = $orig_vid;
$build['body']['#object']-&gt;vid = 100;


thanks Gulok for answering this