This module allows to create micro sites from a Drupal 8 site.

Micro site is usable right now for production but architecture can be changed during alpha phase without upgrade path.

INTRODUCTION

This module provide a site entity which can be used as a new micro site. Alone, you can only publish a micro site as a one page site. But Micro site is extended by :

The main idea is to provide the ability to publish many multiple sites from one Drupal instance, as Typo3 can do for example.

You can set multiples site types (one page, generic, event, etc.) and configure them differently. After configuring micro site and its related module, the main work to do is some site building (adding Fields to site entity to provide a header or/and a footer, place block with a correct visibiity, etc.) and some twig theming with your theme.

Node can be shared between site entities, and between the master host and sites (in both directions).

Users can be added to each sites entities, with different permissions per site.

REQUIREMENTS

The Drupal project on which Micro Site is enabled must be accessible from a fully qualified domain name (or a local domain for development purpose). Otherwise, if using 127.0.0.1 or localhost, Micro Site will not work.

INSTALLATION

Install as you would normally install a contributed Drupal module. See: https://www.drupal.org/documentation/install/modules-themes/modules-8 for further information.

CONFIGURATION

Once Micro Site is enabled you should configure immediately settings for Micro Site module. In particular, you must immediately configure the three parameters base_url, base_scheme, public_url. The absence of these parameters can lead to a 404 page on the master instance's home page.

You can override theses settings in the settings.php file. For example :

$config['micro_site.settings']['base_url'] = 'microsite.local';
$config['micro_site.settings']['base_scheme'] = 'http';
$config['micro_site.settings']['public_url'] = 'microsite.local';

Each micro site create automatically (when created) a file in the directory DRUPAL_ROOT/sites/default/hosts with the corresponding trusted_host_patterns setting.

You have to add to the settings.php file the following lines in order to include these files.

$dir_hosts = $app_root . '/' . $site_path . '/hosts';
if (file_exists($dir_hosts) && is_dir($dir_hosts)) {
  foreach (glob($dir_hosts . '/*.host.php') as $filename) {
    include $filename;
  }
}

DOCUMENTATION

There is still a lot of work to be done about the documentation. But you can find an introduction to the module, and a brief tutorial here Small sites, large sites, micro sites with Drupal 8. And you can have an example to build a footer for a micro site (Provide a footer to a micro site with Drupal 8). Of course there is plenty others ways to build such features (block, fields).

Supporting organizations: 
Development and maintenance

Project information

Releases