Importing Static HTML Pages documentation for the dotCMS Content Management System

You easily import static HTML pages using dotCMS from other sources (such as when migrating a pre-existing site to dotCMS). There are two basic approaches to importing static HTML content into dotCMS:

Import Static Files Directly

dotCMS can directly serve static HTML pages and content, so you can directly upload static HTML pages and content into dotCMS and serve the pages directly from your dotCMS site.

Note:

To upload static content directly into dotCMS:

  1. Upload the content into the dotCMS folder hierarchy
    • You can upload existing content into dotCMS using the Site Browser.
    • However if you have large numbers of files or file structures with multiple subfolders to upload, it may be easier to use WebDAV.
  2. Ensure all code and files reference the appropriate location in the dotCMS folder hierarchy
    • If all of your existing references are relative, then all references should work after you upload the content to dotCMS as long as you ensure that the uploaded content maintains the same relative paths (subfolders, etc.) as it did in the original file.
    • However if you have any absolute references in your uploaded content, or you choose to upload content into different locations in dotCMS, you will need to modify the paths to point at the appropriate file locations in dotCMS.

Convert Static HTML Pages to dotCMS Content

Static content the you upload directly into dotCMS will display properly, but may be more difficult to manage than standard dynamic dotCMS content.

When you upload static content directly into dotCMS, any non-HTML files you upload (such as images and CSS files) will be automatically converted to the standard dotCMS File Asset content type, allowing you to access these files from other dotCMS content as you would any other dotCMS file.

However when you upload HTML pages into dotCMS, those pages are uploaded as Simple HTML Pages into dotCMS, and can't take advantage of other dotCMS features (such as templates and containers, easy addition of content and widgets into an existing page, Content Types, etc.).

To enable your pages to use all available dotCMS features, you can convert the static HTML pages to regular dotCMS content, using the following basic process:

  1. Extract common/shared page elements (such as headers, footers, navigation, logos, etc.) into either a Theme or an Advanced Template.
  2. Extract the text portions of the page (including HTML formatting, where appropriate) into standard dotCMS content (such as the “Content (Generic)” Content Type).
  3. Extract any code in the page into one or more Widgets.
  4. Create a new Page Asset, using the appropriate Theme or Advanced Template (step 1, above).
  5. Add the content and code (steps 2 and 3) into the new page.
  6. Change the URL of the new page to replace the URL of the original (static) page.