I'm in the process of migrating my site from Geeklog to Drupal (yikes!), and I have a question that applies to Drupal in general. Is there any simple way to create "page" nodes and have them display without any blocks, styles, etc.?

Basically, Geeklog used to have an option for its static pages called "Blank Page." You could use the content-posting interface to post a pure HTML page, and by selecting "Blank Page" from the pull-down menu on the content submission form, that page would dispaly as though it weren't even a part of Geeklog -- no blocks, no headers, not even any CSS applied to it (unless you added your own). You could still edit it using the admin interface, but it would display as pure HTML independent of any Geeklog trappings. To an outside observer, it would look as though the page weren't even a part of a Geeklog site. ( See earthconsciousrevolution.org and The Real Matrix, for example. The only reason you can tell via URL that it's Geeklog is because I chose not to do masked domain forwarding. )

I'm looking to do the same in Drupal, but I can't seem to "break out" of the block/theme structure as easily as I could in Geeklog. I post a "page" node, and it has all of the blocks, headers, etc. One possible solution that I found was this:

http://drupal.org/node/56546

But for some reason, when I tell it to hide a block on all "page" nodes, it also hides them on admin pages -- and it still doesn't do away with style info such as the page background, etc.

I could just create static pages manually, upload them to a separate directory, and link to them in blocks etc. But I want these pages to be editable via the Drupal admin interface so that (A) I can edit them while away from home, and (B) authorized users can edit them without knowing my FTP info.

Any ideas?

Comments

nevets’s picture

To achieve what you want we need a new (or at least unique) content type for this, add/modify template.php to your theme, a "replacement" page.tpl.php and possible custom theming for your content type.

For these exercise we will use the page type and assume it is only used for these "bare-bone" pages. You could also create your won content type. The important thing is all content of the selected type will be show "bare-bones".

First in your theme directory create a template.php file if there is not already one there. Add the following to template.php

<?php
function _phptemplate_variables($hook, $vars = array()) {
  switch ($hook) {
    case 'page':
      // Change page to what ever content type you are using.
      if ( $node->type == 'page' ) {
        $vars['template_file'] = 'bare-bones';
      }
      break;
  }

  return $vars;
}
?>

Copy page.tpl.php to bare-bones.tpl.php. In bare-bones.tpl.php replace everything between <body> and </body> with

<?php print $content ?>

Now this is real bare-bones not title and no view/edit tabs. You may wish to also include those copy node.tpl.php to node-page.tpl.php (replace page with whatever content type you are using) and always print the title here (normally only printed here for teaser) and if you don't use the view/edit tabs you may wish to include an edit link for those who have permission.

Treesong’s picture

I'm getting closer to figuring this out... but still not there yet... :) So far, I've come up with a simple theme-based hack for the Chamelion theme. Basically, I insert this snippet of code into the chamelion.theme file right underneath the line that grabs the node's title:

  if ($title == "whatever") {   
    echo $content;
    return "";
  }

I could refine it a bit so that it would check if the page title starts with "PAGE" rather than tying it to a single specific title. It'd be kinda lame to have to start the name of each of these pages with "PAGE" but I could live with it.

The only remaining problem is that this solution still leaves a little unwanted snippet at the end asking if I'd like to comment on the page. Maybe I can just turn off comments for pages... or, I could be really brutal and force it to stop executing the page once it's loaded the content. :)

If you can think of a more elegant way to do this, or a way that doesn't leave the little comment snippet at the bottom, let me know.