Skip to content

Instantly share code, notes, and snippets.

@asanchez75
Forked from samuelsolis/drupalphpheader.module
Created December 26, 2016 12:01
Show Gist options
  • Save asanchez75/540dc4fa61560ee18990268cff1f8ff4 to your computer and use it in GitHub Desktop.
Save asanchez75/540dc4fa61560ee18990268cff1f8ff4 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