1

I'm new to Drupal development and this question may have been asked and answered but I haven't found an answer that works for me yet.

I am developing a module that creates 4 paths using a menu_hook. Three of the pages appear inside an iframe defined on a page. I'd like to prevent the header/sidebars/footer (and other regions other than content) from appearing on the iframed page. This must be done independent of the theme - I don't know or care what the theme is.

I'd like the iframed page to only contain the content tags. I want to do this programmatically without the help of any additional modules. The iframed page executes a js script (on load) that redirects (the parent) to a results page. It is during the redirect that I can see the loaded iframed page and then the redirection occurs. The transition is ugly.

I have tried using templates in the module directory; however, I don't think I've done them correctly and haven't yet encountered a good example of a template loaded and used from a module directory.

I have tried a hook_page_alter function to unset the regions (but the header and footer still appear on the page).

I've tried a theme_hook function but I'm only interested in suppressing some of the regions the theme may be using and not interested in variables.

Because I don't know what the theme is and I don't know what the selector names or classes might be for the page divs I don't want to try and solve this with a few "display:none;" entries in a css file. Any help or ideas would be appreciated.

0

Module:

  • The Empty Page module is a simple empty page solution. It provides an interface that assists in managing "empty" menu callbacks, mostly used for pages that only consist of blocks.
  • The Panels module allows a site administrator to create customized layouts for multiple uses.
  • Context allows you to manage contextual conditions and reactions for different portions of your site. For each context, you can choose what blocks to show.

Theming:

  • Template suggestions are alternate templates based on existing .tpl.php files. You can write in preprocess_page , where put condition and if true, assign page template to page--empty.tpl.php - here you should remove all regions printing except content - so you will get empty page.

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.