Using as a project demo

Last updated on
25 January 2018

Evaluate Drupal projects online

Target audience: Drupal project maintainers.

On Drupal project pages you might find a 'Try a demonstration'  link to evaluate it. A good project demo is one where you can fiddle with the settings and for this, you need to provide admin access in a temporary sandbox. This is where comes in handy by allowing anyone to create a temporary Drupal website with any module, theme, or distribution.

The website creates a temporary sandbox site with a chosen project enabled. In a demo, you might want some sample content, need an API key to be set, or another module to be enabled. This page will describe different methods to provide example content for your demo on

When having trouble check out the project issue queue

#Pre-setting the submission fields

To make it easy to use as demo site, you can manipulate the submission settings by URL parameters. By doing this, a person clicking on the demo-link from your projects page only has to hit the "Launch sandbox" button on

Specifying the project (the newest available version will be selected):

Setting a specific version:

Targeting specific Drupal core with your module:[]=tour_builder.

NOTE: Be aware of PHP parse_str behavior. Arguments for the query must be unique. So better use indexes instead of empty [] like ?add[0]=tour_builder&add[1]=tour_ui

#Providing demo content

#By a sub-module (recommended)

The easiest way to enrich a demo with example content is by creating a demo submodule (eg. a feature module).
While Drupal will ignore it when installing the main module, people can enable it to get an example configuration of your project. This is also useful for people testing a project locally and is a recommended best practice.

You can make sure that your demo module is always enabled on by specifying it in your themes or modules .info file:
simplytest_dependencies[] = demo_module

#By patching the project

The direct URL to preset a project on can be appended with additional modules to download, but also with patches to apply on the main project. Apart from the testing of patches in general, it can be used to modify a module's files for the purpose of making a demo. This patch will only be used when deploying a demo site on and will never be committed to the project itself.

Only patches that live on can be used. You have to open an issue for your module with a feature request like 'Provide a demo with admin access'. You can then upload your patch as usual. An example:

For every patch you want to apply on a project you have to add the patch[]= query to your demo-link, to set the patch to be applied when launching the sandbox:[]=

If you already have a submodule for your demo content, the easiest way to use a patch is by adding a dependency to the main projects .info file for your demo-submodule. When installs the main module, Drupal will now enable the demo module too.

#By creating a demo distribution

This is the only method that shows you the installation screens prior to being operative because it is a distribution. It does not differ from the development of a normal distribution.

If you develop a distro to serve as a demo, it is wise to start with a copy of the 'profiles/standard' folder. At least you know you can rely on the availability of things such as the content type Article and Basic page when adding your code.

A working example of a distribution to showcase a combination of modules:

After implementing one of above methods, edit your project page. Under 'Project resources' in the field 'Demo site' paste the direct URL to use on

#Using code to provide demo content

Using one of the above methods you can mostly make use of the features module to initialize your demo configuration. But you can also use simple code snippets too.

Create sample nodes

Define the $node object, such as the content type, if it is promoted, a title, a body, etcetera. Conclude with node_save($node);. It is wise to create an item 'Sample page' in the main menu using $node->menu.

Enable other modules

Additional modules can be added by but are not enabled by default. If needed they can be activated by your install hook.

An example:

// Enable the popup module.
module_enable(array('popup'), 'FALSE');
Admin quick links

To avoid having to go through long lists of items in the admin menu to search for the relevant settings, it is useful to have some relevant quick links to the module configuration in the navigation menu.

An example:

$item = array(
  'link_title' => st('Popup settings'),
  'link_path' =>'admin/config/user-interface/popup',
Basic configuration

Most settings do have a default value, but some might require a value to be provided, like an API key.

An example:

variable_set('flickr_api_key', '300e007dee02986f6b0a5ec4d2b37580');
Uninstall hook

It is good practice to define an uninstall hook to undo the changes made. It will save you time when testing the modified install file on the development site, as you probably have to install and uninstall it many times.