This project is not covered by Drupal’s security advisory policy.

I want to add several static pages to drupal. To be specific, for example,

<html>
  <head>....</head>
  <body>
    Hi there
    <a href="/node/add/this">Link</a>
  </body>
</html>

No sidebars. No Drupal anything. Just a nice page with some words.

Front module provides an option "Allows for static content to be displayed to the screen as is. This method does not pass through Drupal's theming system.", but it only works on the front page.

I could not find a module, So I decide write this small module to do it.

Installation

  1. Install static_page module.
  2. You should add a dedicated content type, for example “Static page”, to use for static content. Make sure that your content type has a text area field. This module can use any (single) text area field to store the whole source code of the HTML page.
  3. Navigate to “/admin/config/content/static_page” to configure which content types will be used as static pages. For each content type, you select which text area holds the static page content.
  4. Navigate to the “/node/add” page, choose any content type(s) that are configured to be static pages, for example “node/add/static_page”. Here you enter a title (only used for the administrative interface), then put the whole source code of a HTML page into the text area. Save it.

You will get a page exactly the same with your source code. This module lets you bypass Drupal’s theme layer.

If you want to add CSS or JS to the pages, you'll have to put that directly into the <head> section of the static page content.

Security warning

Any content type configured as a static page will bypass Drupal's regular text filtering system. Users with permission to create static_page-enabled content types can effectively bypass any XSS protections. You should only grant permission to create static pages to trusted users.

Project information

Releases