Drupal "Subsites" module allows you to easily create minisites

I just released a new Drupal module. It was one that has been laying around for some time now, but got constantly improved to make it reusable on as much sites as possible. I stripped the feature set down to the minimum and called it "subsites".

Download it at its Drupal project page.

What are subsites?

Subsites are a part of your website that can have its own menu, theme, custom CSS or anything else you want.

An example? Suppose you are making a magazine website. On most magazine websites you might want to create small subsites about a certain topic. This subsite probably has its own menu (next to the primary navigation). It might also have its own look. This new look could be a minimal change from the default site look (a different background, different colors, ...) or it might be a completely new look.

How does subsites do this?

Subsites can be defined in a few manners:
- Marking individual nodes as belonging to the subsite.
- All pages in the subsite menu belong to the subsite.
- Defining paths that belong to a the subsite. This is done in the same way block visibility works. So you can use PHP too!

Subsites can have ...
... their own page template : page-subsites-{subsite-id} or page-subsites-{subsite-slug-name}.tpl.php
... their own CSS file
... their own theme, different from the default theme
... their own menu.

Subsites can be ...
... a condition in Context module (http://drupal.org/project/context)
... used to define block visibility

That's all?

Nope! Themers and module writers can react differently for each subsite using subsites_get_current and subsites_get.

Want even more?

If you're a more experienced user and need more flexibility, sections (http://drupal.org/project/sections) and context (http://drupal.org/project/context) are your thing.

Written on November 03, 2009 at 14:22, tagged as Drupal, modules, subsites

Comments

Thank you for this module! It would be great to have an update for drupal 7.

No, you'll need an access module for that.

Is it possible to assign different roles/permissions to editors so they can write content only for their own minisite(s) ?

This is great, but some help or guide is welcome...

Is it possible to use this module to point different sub domains at Drupal and then display content depending on which one you are viewing?

Subsites is developed for a specific use case. You'd prefer this if you have multiple "sections" that each have their own menu block. It is easy to add stuff to the section for editors by adding stuff to the menu or by marking nodes as belonging to that section.

Maybe its easier to see subsites as an editor tool and sections as a webmaster tool? I've written Bèr about where he's heading with Sections and saw him heading more in that direction.

I'm curious to know how Subsites differ from Sections? If Sections is more advanced it might be nice to have an upgrade path from Subsites to Sections.

This module will be upgraded to Drupal 7 when the time is ready ;)

I have been searching for a module like that for months now. Awesome!

will this module will be upgraded to 7?

Thanks for contributing it!
Brilliant

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

About

drupalcoder.com is a blog on all things Drupal in specific and LAMP on OS X in general. It is maintained by Davy Van Den Bremt, a Belgian (Drupal) web developer and designer living in Ghent. The goal of this blog is to log all interesting things that have crossed the writer's path while developing Drupal sites. You can read all about Davy's professional activities on his LinkedIn profile. If you want to get in touch, use the contact form.