Hello everyone!
I have successfully set up drupal 6.17 multisite with single sign on module 6.x-1.0-rc1 by sharing tables in a separate database:
authmap profile_fields profile_values role sessions users
made possible by following settings.php add-ins:
<?php
$db_url = 'mysqli://user:password@localhost/drupal_site1';
$db_prefix = array(
'default' => '',
'authmap' => 'drupal_shared_tables.',
'profile_fields' => 'drupal_shared_tables.',
'profile_values' => 'drupal_shared_tables.',
'role' => 'drupal_shared_tables.',
'sessions' => 'drupal_shared_tables.',
'users' => 'drupal_shared_tables.',
);
?>So, here's the tricky part on what this is really about:
The primary links should be the same on all sites (like an index), but NOT the secondary ones nor the navigation. They should be configured seperately for every site. Only the Primary Links should be shared
I expect there to be a way through altering the settings.php like above and sharing parts of tables, but I am not shure how to share parts of tables, if this might be the right aim to go for.
So thank you all for the great help on other topics i could find .. sometimes things get so specific that I open a new discussion ;-) Thanks in advance for all answers or possibilities and help in advance ;-)
Alec
Comments
Hmm... that sounds a lot like
Hmm... that sounds a lot like a domain access issue then. You'd have to share either menu links or menu custom tables and this won't be the same for all the sites based on module configurations. So, either id manually copy the primary links from one to the other, use domain access and see if that'll do that, or setup a views + feeds relationship where one site syncs up the items to the rest. Those r hard to come by right now though since feeds is alpha... those r my guestimates at it though...
Ex Uno Plures
http://elmsln.org/
http://btopro.com/
http://drupal.psu.edu/
solution would be great, of course but ...
I was asked by PM if i have found a solution. I think this would be worth to share ...
I do realize by now, that drupal is not ment for souch a task. this would basically need a complete workaround in the system.
These main menu items (primary links) I figured, would not change that often. Also there are "only" five parallel partner-multi-sites.
So, for my case it was quite clear, what to do after a while:
Forget about setting up a very complex machanism to export a few menu-items and import options for every site that wants to display these links and just go ahead and do the manual work.
Be honest to yourself: how much work is it to get a protion of a menu out of one and into another site on a routine basis, automatically, without (!) having to worry about unstable modules that could make trouble in future or change completely instead of updating?
So, the few minutes of doing this redundant work might be worth it!
still, I found a great, simple trick to get same content or blocks into different sites, if this might be an option (doesn't really work with primary links in Garland, though) ... iframes! Simple, static, reliable.
put iframe.html into all/files folder and just enter a relative path to it. it will always work and is stable and fast.
so, all the best luck for you guys and gals out there with finding best solution.
Sorry. Even after a year and several mor use cases i don't have a drupal-native, clean solution.
Cheers
Alec
Cheers for the reply :)
Shame that it didn't work out better than that though! I've got to share the primary across quite a few different multisites :S
If I can come up with a better solution, I'll post it here :)
edit:
Sharing the menu_links table across all sites, seems to have worked pretty well for me. the only thing I've had to work around, is that I have a quick links menu for each multisite and I've had to name them all differently. Normally this wouldn't be a problem, but because I'm using the same theme for every site and I've included quick links programmatically in the tpl.php file (instead of by block), i've had to do a bit of a workaround in the template.php file.
editedit:
I've come across a problem now (possibly one of the ones you encountered?). I have Menu Attributes installed/enabled across all my multisites and making a Menu Attribute change in the primary menu, carries across all sites (as it should), but standard things like enabling/disabling menu items, doesn't carry across the rest of the site. will attempt sharing some other tables and see how it goes.
Didn't work :(
I'm not sure if you had this problem Alec, but my experiences with sharing menu tables has also lead me to failure.
My goal: To share the primary_links menu across my multisite installs (about 9 multisites), so that an update one one site, carries across all others as well. I also want to create other menus that don't appear on every site (these menus are 'quick links').
What I did: Shared the menu_links table. I didn't share menu_custom, because I didn't want all menus to appear on every site (each site has different content editors and I don't want them contaminating other site's menus). I didn't share the menu_router table either, because it looked like it was made up of all admin links.
Why this didn't work:
Initially, it was pretty good. It worked exactly how I thought it would, then all of a sudden, I started getting random items in my primary links menu, when content was created. I would then go into the content and notice that the Menu Settings was enabled and was adding this link into the primary menu. This definitely did not happen as the result of me creating a menu item myself.
My first solution was to disable access to the Primary Links menu, for that particular user account (using the Menu Admin per Menu module). This seems to have solved the 'ghosting' problem, but now I'm experiencing problems where particular quick links menus drop their menu items at random.
I don't know enough about the inner workings of Drupal to draw a proper conclusion, but I get the feeling that when a piece of content is created and a menu item is set using the Menu Settings when you create the content, the node id of the content that the primary menu is linking to and the node id of the content in the quicklinks, is clashing (ie, they're the same, because the primary links content nid and the quicklinks content nid are on separate sites) and giving me these unusual occurrences. Like I said though, I don't know enough about the inner workings of Drupal to figure out if this is the case or not.
Now that the primary links for the sites won't be updated all that often, I'm planning to go back to not sharing the menus, but will keep looking for other ways to achieve this, as it is still going to save me more time in the long term.
As always, if anyone else has a solution or something to add, I'm all ears :)
Wouldn't it be easier to use
Wouldn't it be easier to use a separate DB for what you want? Of course that would mean writing a module that redirects calls to primary navigation to the uniques DB. You'd also be able to use it with any theme.
Just wondering.
Features
I would use the features module. I'm assuming that since it's shared across sites it doesn't get changed that often. You can create the menu, export it using features. Enable the module across sites and every time you need a new menu item you can change it on a site, export the feature again then run a feature update on each site.