hi,

i need empty page where i could import views with a code like, for example, this:

 <?php
$block = module_invoke('block', 'block', 'view', 31);
print $block['content'];
?>

i tried to use taxonomy theme and it does give an empty page, but with all those additional editing fields for node author or administrator. and i need pure views import without header, footer, menus or anything else. just content area. can anyone advice how to get that?

thnx.

Comments

yngens’s picture

probably it will be more clear to say not empty, but themeless page. i need themeless page where i could pull up any views. how to do it?

jpoesen’s picture

Hi

you can use a template file that overrides the standard page.tpl.php file. If your empty page is node 7 for example, you can create page-node-7.tpl.php and do what you want in there without affecting any other page.

There's also some handy info here: drupal.org/node/117491 with a slightly different approach.

Good luck.
J.

TrainingCloud.io - Drupal Training with a Heart.

yngens’s picture

thank you jpoesen, that meets my need.

jpoesen’s picture

you're welcome.

TrainingCloud.io - Drupal Training with a Heart.

elusivemind’s picture

I have created a module which adds a "Themeless Node" checkbox option to node pages. Nodes checked with this will only have their content displayed. Note this is for Drupal 7 only. I will be posting it here before very long.

ChevronTango’s picture

I stumbled upon a nifty solution which I'm using within my theme itself.

First you create a blank page--ajax.tpl.php file and in it put:

<div style="width:auto; text-align:center"><?php if ($page['content']) : ?><div class="content-middle"><?php print render ($page['content']); ?></div><?php endif; ?></div>

then in youre template.php file add:

function theme_preprocess_page(&$vars) {

  if ( isset($_GET['ajax']) && $_GET['ajax'] == 1 ) {
        $vars['theme_hook_suggestions'][] = 'page__ajax';
  }

}

And your done. Whenever you go to a page that you want to view without theme simply type "?ajax=1" after the URL

for example

http://www.example.com/node/7?ajax=1