Advertising sustains the DA. Ads are hidden for members. Join today

Contributed modules documentation

Domain Access documentation

The Domain Access project is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The module allows you to share users, content, and configurations across a group of sites such as:

  • example.com
  • one.example.com
  • two.example.com
  • my.example.com
  • thisexample.com <-- can use any domain string
  • example.com:3000 <-- treats non-standard ports as unique

By default, these sites share all tables in your Drupal installation.

The module uses Drupal's node_access() system to determine what content is available on each site in the network. Unlike other multi-domain modules for Drupal, the Domain Access module determines user access based on the active domain that the user is viewing, rather than which group or site the user belongs to.

Use-Case

The module was initially developed for a web site that sold franchises of a monthly magazine. The publishing rules were as follows:

  • Content may belong to the national site, one or more affiliates, or to all affiliates.
  • National editors may select to promote affiliate content to other affiliates, the national site, or to all affiliates.
  • Local editors may only create and edit content for their own affiliate sites.

These rules are enforced programmatically by the Domain Access module. There was concern that, if given a choice to make, local editors would not assign the content correctly. Therefore, the module handles this automatically, and local editors have no control over which domains their content is published to.

This video from DrupalCon Paris explains the module in detail.

Examples

For the original example of the module in use, see http://skirt.com/.

For case-studies, see:

Advanced Module Configuration

Documentation on this page includes:

Assigning Users to Domains

New starting in 6.x.2 is the concept of 'user defaults.' These settings are used to assign users to domains based on the user's site roles.

Basic Module Configuration

The settings for Domain Access are listed on the Domains page (Drupal 7: Administration > Structure > Domains, or http://example.com/admin

Blocks

The Domain Access module provides two blocks, which can be used to help you debug your use of the module.

Developer notes

The Domain Access module is meant to be the core module for a system of small modules which add functionality.

Differences between 7.x.2 and 7.x.3

The Domain Access Module is available for Drupal 7 in two versions:

Drush Commands

Domain Access 7.x.3.x supports Drush version 3.x and higher. The following commands are available. Type 'drush help' for more information.

Exporting domain configurations

Domain configuration can be exported with the Features module.

FAQ

If you are having a problem with Domain Access start by looking at this list of Frequently Asked Questions (FAQs). If the answer to your

Helper modules

The Domain Access module works by itself and needs no additional modules. Included in the download are these helper modules that extend the

Node Access

The Domain Access module is a node_access() module. For additional developer information, see http://api.drupal.org/api/group/node_access.

Permissions (Drupal 7)

After enabling the module, go to Administration > People > Permissions (http://example.com/admin/people/permissions) to configure the module

Permissions (Drupal 8)

After enabling the module and creating some domains go to Administration > People > Permissions (http://example.com/admin/people/permissions

Related contributed modules

The following modules have been contributed by other developers to extend the features of Domain Access.

Troubleshooting

Before using the module, you should read the installation instructions. Failure to install or uninstall this module according to

Uninstalling

When you disable this module, it will reset your {node_access} tables and remove all records from the {domain_access} table. This will

Upgrading to Domain Access 7.x.3

Upgrade instructions

Upgrading to Drupal 7 using Domain Access

These instructions apply to both 7.x.2 and 7.x.3; you may upgrade directly to either version.

Guide maintainers

croryx's picture