I am trying to create a multi-site community where each site gets much of its content from the main site but some of the content will be unique to the site. I have searched the forums and google and haven't been able to resolve some of the issues.

My goal is to have a group of sites with a common core interest but serving different communities. For example, the main site (www.mainsite.com) would have the common stuff (such as news posts and blogs about a geographic region--like Colorado, USA). Each community site would contain everything from the main site but also have information about the specific community.
--A farming community site would have info on farming in Colorado plus the common content from the main site.
--A recreation community site would have info on recreation in Colorado plus the common content from the main site.
--An education community site would have info on education in Colorado plus the common content from the main site.
The community specific info would not be visible on the other community specific sites. A central administrator adds content to the main site. Authenticated users add content to the community sites. Users can log into any of the community sites (i.e. shared user tables). Some of the unique content on the community sites will be specific to groups (i.e. a sports league) so I will be using organic groups.

I currently have multiple sites (using subdomains currently) working with the different themes for each and all content is shared (though I can manage the blocks to hide some content from non-savvy users).

Here is the setup using the example above:
Drupal installation is in www.mainsite.com/drupal

the /sites directory contains:
/default
/themes
/defaultheme
settings.php
/farming.mainsite.com
/files
/themes
/farmingtheme
settings.php
/recreation.mainsite.com
/files
/themes
/recreationtheme
settings.php
/education.mainsite.com
/files
/themes
/educationtheme
settings.php

I currently am sharing the entire database with no prefixed tables.

each settings.php has:
$db_url = 'mysql://username:password@localhost/databasename'; (common in each site)
$base_url as http://farming.mainsite.com (unique to each site)
$conf = array(
'site_name' => 'Farming Community', (unique to each site)
'theme_default' => 'farmingtheme' (unique to each site)
);

I have 3 current problems/challenges:
1) The community sites currently cannot see files/images uploaded from the main site. These are currently in /drupal/files under the "Public Download" method. We expect this site to become quite large so we don't want the overhead of the "Private Download" method. The node_revisions table shows the img src for the main site files as Only local images are allowed.. My guess is that a directory "relative to the drupal installation" as required under "Public Download" is different for the main site vs. the multiple sites. Any ideas?

2) How can I make the content added by users in each community site visible only to that site? If I use taxonomy it seems that a user entering a blog on farming.mainsite.com would have to make sure he/she chose the "farming" category and not "recreation" or "education" since all three would be visible on each site, right?

3) I am having problems with authenticated users trying to log in to the community sites. As an administrator I can see that a session was opened for them when they enter their user name and password, but they never "enter the site" as the User Login block remains and they cannot function as an authenticated user--just as an anonymous user. This is not the same problem as the occasional "login twice" problem as these users never get in.

I admit I am a relative newbie at this. But from reading the forums, etc. it appears that this functionality is possible but I haven't found solutions or resolutions.

Thank you so much in advance for any help you can provide!

Comments

bottdev’s picture

Here is a better format for seeing what is in the format directory:

the /sites directory contains:
/default
--/themes
----/defaulttheme
--settings.php
/farming.mainsite.com
--/files
--/themes
----/farmingtheme
--settings.php
/recreation.mainsite.com
--/files
--/themes
----/recreationtheme
--settings.php
/education.mainsite.com
--/files
--/themes
----/educationtheme
--settings.php

Michael Phipps’s picture

I'm posting this for the benefit of others who may still be hunting for a solution and have come across this post.. Check out the domain module.

From the project description:

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

http://drupal.org/project/domain

WeRockYourWeb.com’s picture

Sharing the database is probably causing some issues. You may want to check out my "multisite guide" to see if there's anything in there that can help you:

Drupal Multisite Configurations and Hosts

Cheers,
Alex

----------
Contract Web Development

bottdev’s picture

Thanks, Alex. I actually used your guide to help me get to where I am now.

But if I want to share some content and not others, how can I implement that without sharing the databse?

Thanks.

styro’s picture

have you thought about using organic groups instead?

see http://groups.drupal.org for an example of a more fluid separation of content into different 'sections'.

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

bottdev’s picture

I will incorporate groups in each of the community sites, but groups don't seem to satisfy the need to have the content from the main site also appear in the community sites.

I want to have several blocks and menu items on the community sites that have content from the main site. This content could include blogs, classifieds, etc. that would be common to all the communities.

Then I want to have blocks on the community sites that have content unique and specific to each community site. For example, farming tips for Coloardo farmers.

I also want to have some organic groups on the community sites that would require users to subscribe to become part of it. For example, a group for a local farming co-op could have their own group with their own members and the content of that group would be hid from others visiting that community site.

Finally, I want users on the community sites to be able to post items that would be common to all the community sites (i.e. becoming part of the main site content). This could include classified ads, for example.

I am not so concerned about savvy users being able to access content from a different community site by manipulating the urls.

So I think that the way to implement this is to have a shared database and somehow identify the nodes as belonging to one community or another.

I know that with different themes, I can have different blocks appear for each site. Can I manipulate what apears in the available blocks with php using the $base_url somehow? Is there a way to identify certain nodes or groups by what $base_url they were created under?

Thanks for any help.

styro’s picture

using multisite and the single sign on module for a pretty standard (if you could call it standard) set of sites that just share users and sessions.

Then use the publish and subscribe modules to share the common content between the sites via XML-RPC.

I suspect that would be simpler than trying to somehow share nodes at the DB level - which sounds very messy.

I haven't really used those modules in production though, and also have no idea how 5.x ready those modules are :)

--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ

bottdev’s picture

I'll look into those modules. I hadn't condsidered them, but the concept makes sense.

If anyone else has other ideas, I'm still very open.

Thanks!

ChrisBryant’s picture

This may be a bit late for you, but have you seen/tried the multidomain module?
http://drupal.org/project/multidomain
http://bryght.com/blog/adrian/multidomain-module-for-drupal-5

Chris


ALIAN DESIGN

Anonymous’s picture

Hi Styro,

I little late but I think your suggestion is interesting.

Then use the publish and subscribe modules to share the common content between the sites via XML-RPC.

Which modules are you referring to?

Thanks very much!

Joep

styro’s picture

The new faster tracker listing makes it hard to spot new replies to old threads...

Anyway - the modules:
http://drupal.org/project/publish
http://drupal.org/project/subscribe

But as I said, I've never used them and they look a little "unmaintained" at the moment (ie no Drupal 5 releases etc).

--
Anton
New to Drupal? | Troubleshooting FAQ
Example knowledge base built with Drupal

Anonymous’s picture

Thanks, I just found them myself (I had the filter set to 5.x release).

-----------------------------------------
CompuBase, websites and webdesign

najibx’s picture

Could you share with us how this is done?
Thank you.

-najibx-

Anonymous’s picture

These modules are just not updated for version 5.
You can use the core aggregator module the publish rss feeds from one site to the other.

-----------------------------------------
Joep
CompuBase, Drupal websites and design

kmadel’s picture

Check out my article at Drupal Multisite