Explanation: hosting a minisite website on a GovCMS website (the minisite module)

What is a minisite?

A minisite is a small website focused on a very specific subject. It may look different to the parent website.

Example used in this article: a Campaign website.

What does the minisite module do?

The minisite module can create a small, secondary website on an existing GovCMS website. It allows an existing static website to be uploaded and archived on the parent GovCMS website, while retaining its own look and feel. Files are uploaded using a single .zip file.

Note: The minisite cannot contain dynamic content, such as forms, unless the content can be integrated into the website using JavaScript or iframe.

Where are minisite files saved?

The files that create the minisite can be saved in:

  • the public files directory or
  • an alias, which is defined on the parent website.

Note: Website files in the public directory can be seen or downloaded by anyone with a link to the file.

In which GovCMS distributions is it available?

The minisite module is available in the:

  • GovCMS Drupal 7 (D7) distribution
  • GovCMS Drupal 8.x-1.4 distribution.
    Note: It was deployed as part of the GovCMS D8 update in early June 2020.

Who can enable the minisite module?

Who can enable this module depends on whether your organisation signed up to the Software as a Service (SaaS) or Platform as a Service (PaaS) service offering.

If you are a SaaS customer, the GovCMS Service Desk can enable the module for you:

  • Create a GovCMS service desk support ticket.
  • Include the following information:
    • name of and link to website
    • name of file directory
    • maximum upload size
    • whether to enable the Description field
    • any changes to the allowable file extensions.
      Example: Removing a file extension.

If you are a PaaS customer, you can enable the module.

Who can upload minisite files?

Users with one of the following GovCMS roles can upload minisite files:

  • Content Editor
  • Site Builder
  • Site Administrator.

How many minisites can a website host?

There are no restrictions on the number of minisites that can be hosted on a website. However, as each minisite is uploaded it increases the file storage size of your website. If you upload a lot of minisites to your website, the combined size may exceed your website’s file storage limits. Additional storage can be added to your subscription for an additional cost. Your usage is periodically reviewed and the GovCMS team will contact you if an up-size is needed.

Can the minisite settings be customised?

Yes, a GovCMS customer with the Site Administrator or Site Builder role can customise the minisite settings to:

  • provide help information to website users who can upload minisite files
    See: Who can upload minisite files?, below.
  • specify a maximum file size
    Note: This cannot exceed PHP’s maximum post and file upload limits. Good practice is to limit this to be 100 MB. Large files, such as video files, should be stored on a third-party video hosting platform.
  • allow users to add a description of the uploaded files
  • limit the permitted file extensions.
    See: Permitted file extensions and Prohibited file extensions.

Figure 1 shows the settings screen, which is used by a Site Builder to customise the default minisite settings and provide a Content Editor with help text. Figure 2 shows an example of the screen presented to a Content Editor when they upload a minisite.

Figure 1 minisite settings screen

Minisite settings screen

Figure 2 Example of screens presented to users

Example of screens presented to users
Example of screenshot

Webpage link requirements

A minisite’s webpages can contain absolute and relative URL webpage links. It is good practice to use relative links for links to other webpages in the minisite.

Example: A link to a chapter in the minisite.

Use absolute links for references to webpages that are external to the minisite.

Example: Your agency’s parent website.

Zip file requirements

A minisite is uploaded using a zip file, which must meet content and file extension requirements.

Zip file contents and structure

The zip file must:

  • contain one top-level directory only
    Note: This can contain sub directories, each of which can also contain sub directories.
    See: Figure 3 Example file structure.
  • contain the index.html file
  • only contain files with permitted file extensions
    See: Permitted file extensions and Prohibited file extensions
  • not exceed 100 MB, although this limit can be decreased
    See: Can the minisite settings be customised?
  • pass Clam AV virus scanning.

Figure 3 shows an example file structure. Table 1 (below the figure) explains each component.

Figure 3 Example file structure

Example of file structure

Table 1 Example file structure

Component

Explanation

1

The zip file. In this example it is named our_campaign_website.zip

2

The single top-level directory. In this example is named our_campaign_website

3

The HTML files, including the index.html file.

4

Sub directories in the single top-level directory. In this example, sub directories are for:

  • fonts
  • images
  • JavaScript
  • PDF documents
  • styles, i.e. cascading style sheets.

5

Additional sub directories. In this example the four sub directories for the fonts sub directory are shown:

  • Helvetica
  • open_sans_condensedbold
  • open_sansbold
  • open_sanscondensed_light

Prohibited file extensions

A list of prohibited file extensions is available from the GovCMS service desk.

Permitted file extensions

A list of permitted file extensions is available from GovCMS service desk.

Archive requirements

To be archived the .zip file and its contents must meet the requirements explained in Zip file requirements.

URL rewrite (alias)

After the minisite file is uploaded the user can choose to use an alias to present the minisite website. This rewrites and updates internal links. Table 2 and Table 3 explain the rules.

Table 2 URL rewrite (alias) rules

Tag

Rule

<link>

If the link is external, it is not changed.

All other links are rewritten so that they always point to the corresponding expanded (unzipped) file in the file system.

<script>

<img>

<base> tag in <head>

Always remove.

<a>

See Table 3, below.

 

Table 3 <a> tag URL rewrite (alias) rules

If the <a> tag link is…

And it is…

Then…

external

-

it is not changed.

to a HTML document

relative to root

i.e. starts with ./ or /

rewrite link to point it to the aliased path.

relative to other documents

i.e. starts with ../

rewrite link to always point it to the aliased path.

to a non-HTML file

-

rewrite it to always point to the corresponding expanded (unzipped) file in the file system.

More information