Skip to content

Instantly share code, notes, and snippets.

@samuelsolis
Last active December 26, 2016 12:01
Show Gist options
  • Save samuelsolis/8647592 to your computer and use it in GitHub Desktop.
Save samuelsolis/8647592 to your computer and use it in GitHub Desktop.
Add custom php header to a drupal 7 view
function MYMODULE_views_pre_view(&$view, &$display_id, &$args){
if ($view->name == 'VIEWNAME' && $display_id == 'DISPLAYNAME'){
$header = 'MYCODE';
$options = array(
'empty' => 1,
'content' => $header,
'label' => NULL,
);
$view->add_item('DISPLAYNAME', 'header', 'views','area_text_custom', $options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment