Commit 0e961862 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-481] Unset content, sidebar region blocks on unl-404 page

parent 91977061
......@@ -114,8 +114,23 @@ function unl_context_page_reaction() {
function unl_page_alter(&$page) {
// Add UNLcms technical feedback link to toolbar
if (isset($page['page_top']['toolbar'])) {
$page['page_top']['toolbar']['#pre_render'][] = 'unl_toolbar_add_links';
$page['page_top']['toolbar']['#pre_render'][] = 'unl_toolbar_add_links';
}
}
/**
* Implements hook_block_list_alter().
*/
function unl_block_list_alter(&$blocks) {
// Hide all content area blocks on 404 page if using the 'unl-404' menu callback.
$status = drupal_get_http_header('status');
if ($status == '404 Not Found' && variable_get('site_404') == 'unl-404') {
foreach ($blocks as $key => $block) {
if (in_array($block->region, array('content', 'sidebar_first', 'sidebar_second'))) {
unset($blocks[$key]);
}
}
}
}
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment