Skip to content

Instantly share code, notes, and snippets.

@vensires
Created April 2, 2018 15:04
Show Gist options
  • Save vensires/cd7f886c3ab8182601f2c77f6e2d07b8 to your computer and use it in GitHub Desktop.
Save vensires/cd7f886c3ab8182601f2c77f6e2d07b8 to your computer and use it in GitHub Desktop.
The following code is useful when using links with the .colorbox-load class following the pattern "http://www.example.com/path?width=500&height=500&iframe=true". Only the page content region is displayed and everything else gets hidden
<?php
/**
* Implements hook_process_page().
*/
function MYTHEME_process_page(&$variables) {
if (!empty($_GET['iframe'])) {
foreach (element_children($variables['page']) as $index) {
if ($index == 'content') {
continue;
}
$variables['page'][$index]['#access'] = FALSE;
}
$variables['logo'] = '';
$variables['main_menu'] = array();
$variables['secondary_menu'] = array();
$variables['tabs'] = array();
$variables['title'] = '';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment