I'm looking for a method to display content (nodes) in a shadowbox overlay without any blocks or menus around it. even if the user is logged in.

Has someone an Idea how to do this are there even better parameters for rel shadowbox than the height and width parameter to reduce the window size?


For Drupal7:

Add to your theme template.php (or add inner of function code to existing function prepropress_page closer to the end) next function:

 * Override or insert variables into the page templates.
function YOURTHEME_preprocess_page(&$vars, $hook) {
  if (isset($_GET['shadow']) && $_GET['shadow']) {
    $vars['theme_hook_suggestions'][] = 'page__empty';

Add page--empty.tpl.php to your theme folder - take original copy from page.tpl.php, but remove printing all header, sidebars, footer regions. E.g.:

 * @file
 * Returns the HTML for Drupal page only with content region = empty page.
<?php if ($title): ?>
  <h1 class="page__title title" id="page-title"><?php print $title; ?></h1>
<?php endif; ?>
<?php print render($page['content']); ?>

Make shadowbox scripts added to any page (shadowbox ui settings), and you can do next anywhere:

<a href="/node/1?shadow=1" rel="shadowbox" title="About">About</a>

So, any link with url?shadow=1 and rel="shadowbox" will shown on shadowbox popup window only content without sidebars. Control size of window on rel="shadowbox" as documented.

For shadowbox links that generated automatically (views, fields) you should override it via settings or template.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.