Анатолій Поляков — Subdomains everywhere

Preview:

Citation preview

Subdomains everywhere Practices of using subdomains in Drupal websites.

Version 1.0Oct 18th, 2015

What is the goal?

Our goal is to move some parts of the website powered by Drupal to the subdomain

1. Nodes on subdomain;2. Parts of the content at subdomain;3. Terms on the subdomain;4. Custom pages at the subdomain.

Subdomain processing diagram

Existed contrib modules1. Domain Access (https://www.drupal.org/project/domain).

Stable module for configuring subdomains as part of multisite project.

2. Subdomain (https://www.drupal.org/project/subdomain).

Stable basic module for subdomain processing at one Drupal installation.

Main features:

- user, taxonomy, content type, OG => subdomain.

3. Subdomain field (https://www.drupal.org/project/subdomain_field).

Alpha module for managing subdomain as field item.

Coverage of contrib for this feature is very weak.

Existed issues problems1. There are no views integration.

2. There are no context plugin.

3. Contrib modules have many issues and bugs.

4. There is no complete solution for homepage.

Subdomain module

Custom code variants1. Model part: hook_outbound_alter().

2. Controller part - domain checking.

hook_url_outbound_alter1. Altered domain parameter at L-function

2. Has entity object in arguments.

Controller part.1. Create subdomain_get function.2. Use it across project.

Example

Configuration steps1. Domain needs wildcard record;

2. Webserver should route all domains and subdomains to one drupal

folder.

3. For session saving along all subdomains, we have to add record at

settings.php file.

Search engine double indexing problem.

Q&A

Thank you.

Contacts

skype:anpolimus

site:techdirector.me

FB: https://www.facebook.com/anatoliy.polyakov

Recommended