Share alias amongst multi-site

Events happening in the community are now at Drupal community events on www.drupal.org.
Anonymous's picture
Posted by Anonymous on February 16, 2009 at 2:28pm

Hi,

first time I'm posting but I've a small problem.

I'm running multisites which are sharing nodes, content_types, users and roles. I'm doing it just by sharing the tables on the same database.

I'm using Autopath with the same config on each site to enable some "smart" aliases for each content type.

I've a "static" content which is a content that is supposed to be used for static pages with one alias and that won't be dynamically used as a blog post or a news or an event.

What I want for this content type is to be able to aliases its nodes with the same alias in different sites (e.a. I want to have a page "services" in each of the sites and for each site it would be a different node...

So to be clear, I have

http://mainsite.com
http://site1.com
http://site2.com

What I want is to have

http://mainsite.com/service
http://site1.com/service
http://site2.com/service

pointing each time at different nodes.

I tried already just to share the url_alias table but when doing that it appears that the content of the nodes is not stored (aothough the node is created in the node table, but nothing is created in the content_type_static" table).

Can anyone has a clue on this???

Best regards

Categories:

Comments

Kind of a problem

Posted by emptyvoid on March 11, 2009 at 6:41pm

Hello,
I see what you are asking and unfortuately from what I know about multi-site installation and content you can't share all of your content and have exceptions.. You would not be able to share content nor path aliases to support having unique nodes for the same alias for all sub-sites.

1) Unique tables per site
Instead of sharing the nodes tables use a script to replicate the content from one site to another. Sure you would have to replicate the pages every time you had a change. But if the pages and structure of the site is identical you could dump the date from the "holding" tables and load the data into each sub-site tables.

Obviously that is a lot of work, so what if you..

2) Custom page or node template in the theme.
Create different nodes for each sub-site for the "services" page then write conditional php in the node or page.tpl for the theme to use a different node for the path based on site URL. This is a total hack, but would work for the specific requirement you stated. It of course totally become unmanageable if you have 50 or 100+ pages that require this type of conditional.

3) The hard way.
Plain and simple don't share your content at all.
The simple solution is to make the content, paths, and menus unique for each site that way there are no conflicts between the content ever. Sure you have a lot of duplicate content, but it also means that the sites are isolated so if you screw up on the rest will still work.

Also if you don't update the content often even having 100+ sub-sites are not totally hard to manage. But if you have constant changes then I would recommend using sql and or php scripts to handle bulk updates to multiple site tables.

Robert Foley Jr
Solutions Architect
http://www.robertfoleyjr.com

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /