Serve static HTML from Drupal 7

Ever wanted to serve a static HTML  page from Drupal? A quick-and-dirty was of doing this is as follows:

  1. Create a new subtheme from Zen or your favorite base theme, or roll your own. Maybe call it “Blank Theme.”
  2. Trim down your theme’s html.tpl.php file to look like this:
     <?php print $page; ?>
  3. Trim down your theme’s page.tpl.php file to look like this:
    <?php print render($page['content']); ?>
  4. Create a content type called “Static HTML” and paste the entire HTML doc in the body field of nodes of this content type. Ensure that the text filter for either defaults to “Full HTML” sitewide, or for this content type by using .
  5. Use to create a rule that switches the theme to “Blank Theme” for this content/node type.
  6. [OPTIONAL]: Create a new content type called “File Attachment” and use to manage any image or other assets in your static HTML through the Drupal UI. Use the links that this module provides to create a permalink to these files, thus avoiding Drupal’s default behavior or renaming new files uploaded to a given field. Otherwise, just reference your assets via <img src=”/hardcoded/path/to/theme/image01.png”/> and such.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: