Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Extending Domain Access

Video loading...

  • 0:00
    Extending Domain Access with Addison Berry
  • 0:04
    So in this short introductory series on Domain Access,
  • 0:08
    we've covered a lot of the just basic,
  • 0:12
    sort of major features of Domain Access,
  • 0:15
    which was we got everything installed properly,
  • 0:18
    and then we looked at how to manage content,
  • 0:22
    so creating content, sharing content, keeping it within a particular domain.
  • 0:27
    We also looked at how to deal with various settings
  • 0:31
    so that we could change things on our site per domain,
  • 0:35
    like the home page node.
  • 0:38
    We also changed the theme for the alumni site.
  • 0:41
    And then we looked at permissions, which is a large part
  • 0:44
    of what Domain Access provides
  • 0:46
    is at the core of what it's trying to do
  • 0:48
    is help us basically slice up one Drupal site into multiple "sites"
  • 0:54
    using different domains and managing that content by domain.
  • 0:57
    But there are obviously lots and lots and lots of things
  • 1:00
    that you might need to also have be controlled per domain on your site
  • 1:06
    beyond these sort of very core basic features.
  • 1:09
    So while we're not going to get into more advanced topics
  • 1:14
    beyond these basics in this series,
  • 1:17
    I did want to just sort of walk through where to find more information
  • 1:21
    about the additional modules that you can use
  • 1:23
    so that you understand the possibilities that you have,
  • 1:25
    that you're not limited to just these very, very basic core features
  • 1:30
    that we've looked at in the series.
  • 1:32
    So first I'm going to start with the additional modules
  • 1:35
    that actually come with a Domain Access project—
  • 1:37
    we only looked at a few in this series—
  • 1:40
    and talk about what those are and when you might want to use them.
  • 1:43
    And then we'll also find the list of contributed modules outside of Domain Access
  • 1:48
    that can do all kinds of things, again, depending on what your use case is.
  • 1:51
    So we're going to go to drupal.org, again, to find this information
  • 1:56
    at the drupal.org access module documentation. [https://www.drupal.org/node/1096964]
  • 2:01
    So you can get there from the project page, under the Site Building guide.
  • 2:05
    This is the Domain Access documentation.
  • 2:08
    You can find this top Domain Access documentation
  • 2:13
    is at drupal.org/documentation/modules/domain.
  • 2:19
    Once you are in that section, there's this Helper Modules
  • 2:23
    comes right after Installation,
  • 2:25
    and so that's the page that I'm looking at here is this Helper Modules.
  • 2:28
    These are the additional modules, or all of the modules,
  • 2:31
    that come with Domain Access when you downloaded it from drupal.org.
  • 2:35
    This is what we currently have available to enable on our site.
  • 2:38
    Now, in the series, we did just the main Domain module,
  • 2:44
    which is not listed here, but that's just Domain.
  • 2:46
    And then we also ended up enabling Domain Configuration and Domain Settings,
  • 2:51
    and we also did Domain Content and Domain Theme.
  • 2:57
    So we used four of the ones that come aside from the core one.
  • 3:01
    So there's still a few other ones here that we haven't used,
  • 3:04
    and this just gives a nice, brief explanation for what these are.
  • 3:07
    So Domain Alias allows you to specify some domain aliases
  • 3:12
    so that multiple host names are matched to a single domain entry.
  • 3:15
    If you need to use aliases beyond what we've already set up
  • 3:20
    in terms of the DNS directly, then you can use that.
  • 3:23
    Navigation can be really interesting because it's menu items for each subdomain
  • 3:27
    that you can use in primary secondary links.
  • 3:30
    So you get a navigation block for that.
  • 3:32
    So that could be very handy, depending on how you're managing the navigation
  • 3:36
    on your sites, on your different domains.
  • 3:38
    Domain Source allows the editor to set a primary source domain
  • 3:43
    when links are written to content on other domains.
  • 3:47
    So if I'm on the news site,
  • 3:49
    and I'm linking to content that's from the alumni site,
  • 3:55
    what is the source URL for that link? Something like that.
  • 3:58
    Domain Strict—we talked about this a little bit
  • 4:01
    in one of the tutorials about users and permissions.
  • 4:04
    But this forces a user to be a member of a domain in order to be able to view the content,
  • 4:09
    not just create, do all this other management stuff.
  • 4:12
    But if you actually just want to lock things down
  • 4:15
    and not have anonymous users be able to see or do anything,
  • 4:18
    Domain Strict can provide that for you.
  • 4:20
    And then, of course, we did use Domain Theme.
  • 4:23
    Now, you can see that there are a few other things that are listed down here.
  • 4:28
    For Drupal 7, these are standalone modules, all of these that have links here.
  • 4:33
    So they're not part of the package.
  • 4:35
    So prefix user and views were ones that were included in the Drupal 6 version,
  • 4:39
    and they've been split out in the Drupal 7 version.
  • 4:42
    So again, if these are things that you're going to need,
  • 4:45
    things like Domain Views making sense, something like that,
  • 4:49
    Domain User, creating subdomains for users,
  • 4:52
    so as someone creates an account they get their own subdomain.
  • 4:54
    So some interesting stuff but not necessarily sort of the 80% use case
  • 4:59
    that Domain Access package is really trying to tackle.
  • 5:02
    And then we have things like CTools Path,
  • 5:05
    so per-domain path aliases for nodes.
  • 5:08
    This is actually probably one that would be more commonly used, I think.
  • 5:13
    And then we have Domain Variable.
  • 5:15
    So that's dealing with how to—
  • 5:18
    especially if you're working with internationalization
  • 5:20
    and you want to be able to translate variables and things like that.
  • 5:24
    So these are some additional projects that have been very close to the core package,
  • 5:30
    at least in the past or are sort of basic in other ways.
  • 5:33
    But if you notice down here at the bottom,
  • 5:36
    the next thing is Related Contributed Modules,
  • 5:38
    or if you're looking at the navigation, it's the next page that's in this handbook.
  • 5:42
    So this just gives you exactly what it says.
  • 5:44
    This is a list of all the different related contributed modules
  • 5:48
    that do all kinds of things,
  • 5:50
    things like, maybe, say, Google Analytics,
  • 5:52
    and you really need to be able to separate that stuff out.
  • 5:56
    So this list, this page, is an excellent resource for, "I'm frustrated."
  • 6:01
    "This isn't working. I'm going to throw it out the window."
  • 6:03
    Chances are good that somebody else has encountered that frustration
  • 6:07
    and they created a contributed module that helps address those problems.
  • 6:11
    Of course, Domain Access is doing a lot of things,
  • 6:15
    and it's useful in a lot of use cases,
  • 6:17
    but if you find that you're running into lots of problems with it
  • 6:20
    that are not solved by contributed modules that have been out here for a while,
  • 6:23
    you may be trying to bend Domain Access further than it was ever intended to go.
  • 6:28
    So just keep that in mind.
  • 6:30
    There are different ways to approach having multiple sites in Drupal,
  • 6:35
    and this is just one way to do it.
  • 6:37
    But just remember that Domain Access package download is not all you have available to you.
  • 6:43
    So as a quick review, we looked at the additional modules that come with Domain Access
  • 6:48
    when you download it.
  • 6:50
    Plus, I just showed you where you can find the list of other contributed modules
  • 6:53
    that are going to extend Domain Access.
  • 6:55
    And you can do a lot of really powerful things
  • 6:58
    as you put these together.
  • 7:00
    One thing I would recommend though is to build your site out,
  • 7:04
    and as you encounter something that's not working
  • 7:07
    or not being split up by domains the way you like,
  • 7:10
    then go find a module that fixes that and add it
  • 7:12
    instead of just adding a whole bunch of modules or enabling every single module
  • 7:17
    that comes with the Domain Access package
  • 7:19
    and then trying to figure out what's going on.
  • 7:21
    You could end up with way more settings
  • 7:24
    that, A, would confuse you or, B, actually might be overriding
  • 7:27
    what you're trying to actually accomplish unnecessarily.
  • 7:30
    So Domain Access is very powerful, very extendable,
  • 7:35
    and it gives you a really, really nice way
  • 7:38
    to have multiple sites using different domain names
  • 7:43
    on one Drupal site and being able to manage and control
  • 7:46
    all of that from one site.

Extending Domain Access

Loading...

With the basics of our three domains set up, you're ready to build out your sites. We've covered the main steps to get you started, but you'll find that there are a lot more options available to you as you build. Which additional modules you use will depend heavily on your particular needs. In this tutorial we'll talk about the other modules that are included in the Domain Access package, which we haven't used in this series. We'll also look at a list of other contributed modules that work with Domain Access to extend its feature set even further.

Additional resources: 

Domain Access modules (drupal.org handbook)
Domain Access related contributed modules (drupal.org handbook)