Created
April 2, 2018 15:04
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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