I have a Views 3 block whose block title I would like to set using PHP in the header section. This would enable me to use tokens from the views results, which is not possible from the UI.
In the case of a views page I was able to set the page title via the following PHP command in the header section:
$view = views_get_current_view();
$view->build_info['title'] = 'My Page Title';
However, I was not able to do the same thing for block titles via
$view = views_get_current_view();
$view->build_info['title'] = 'My Block Title';
This is probably because the build_info['title']
command only edits the page (or node) title. Does anyone know of an analogous command to set block titles?
YOURTHEME_preprocess_views_view(&$vars)