开发者

Drupal and Multi-sites?

I just want some opinions on what's the best way to go about meeting the following requirements.

I have

  1. One main Drupal Installation
  2. It is a typical "listings" site where users can list items
  3. One user can have how many ever "listings" that are linked to his account

I want to be able to create sub-accounts, that use the same base site. However, for each subsite:

  1. Only the users listings must appear on his site
  2. It must have a completely different theme.
  3. It must have its own menu items
  4. The site must run off it's own domain OR subdomain

I need some answers:

  1. Is this possible, o开发者_高级运维r will each user need a completely new Drupal installation and just use a web service or something to get its listings from the main site?
  2. What modules / components will make my life easier?
  3. Any other suggestions to make this as simple as possible?


The problem description is not detailed enough to give a fully sound advice (and - additionally - it looks like you could probably get better advice on a drupal specific forum, as the question seems more related to installation and configuration than to programming), however - from what I understand - it looks to me that your solution could give in either of the two directions:

  1. Tweaking a single installation to appear as different sites
  2. Creating multiple sites that shares the same codebase and part of the data

The tweaking solution has the advantage that you have only one DB to mantain, but there is no actual real separation between the subsites. You could implement this by:

  • SUBSITES: mapping various subdomains on the same IP
  • CONTENT: using the native permission system to filter which list items to display (for example: each logged user can display only nodes created by himself, or set to be visible to its role, or having as associated taxonomy term its username...)
  • THEMES : if subsites will be used only by logged-in users, use the same mechanism that you would use for filtering content [each user can natively pick a different theme if you allow them to], if they must appear with a different look also to anonymous users, then use the URI to pick up the appropriate theme (if visitor X reaches the site via user1.example.com the site will have the blue theme, whilst if the URI is user2.example.com the theme will be pink).

The multiple sites solution has the advantage that you have a real separation between subsites (with even a different DB). But you would then have to either sync or transfer "on the fly" data between the main site and the subsites. If you go for this solution, you should probably take a look at the following links:

  • the services module, which allows to easy set up webservices
  • this page explaining how to connect drupal to different databases (surely faster than using webservices... reasonable solution if you for example have sites and subsites running on the same server)


I didn't want to stick this in a small comment but I am in agreement with mac on many of his points (upvote!).

The best way would be to create your subdomains and have them be symbolic links in the site folder to the default / main-domain folder.

Given what you have told us, you are much better off creating a module that creates its own node types (or even just CCK) and use a combination of the permission system (CCK offers this as well through content_permission), Views, etc. No need for separate sites, just need users to look at their own content.

The beauty of this approach is you can use Flag to allow user's to friend each other, use Views to allow them to see friend's lists, etc.

Theme's can be set on the account level, so no issues there.

"Have their own men" - does this mean have their own block on the sidebar or header than has customized links or a completely different menu SYSTEM? Will need clarification before I can answer that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜