I cannot find any way of having different menus or blocks in my sub-domains. It's supposed to be a built-in feature. I have all the components of the module activated. I'm using different themes for each sub-domain. But when I make a change to a block or a menu, it's changed for the whole system, main domain and all.
I've been stuck on this issue for several days now and would appreciate some help. Or point me to the solution if it already exists. Thank you.

Comments

skizzo’s picture

You can change the placement of a given block on a per-theme basis. However, the block configuration is shared across all themes. For a solution, you may want to try out multiblock. Domain Access does provide built-in support for Primary and Secondary menu: see admin/build/domain/conf/DOMAIN-ID, Menu Settings fieldset. Note that if you just check the batch update form you will miss the menu setting, as it is not included in there yet (368594). Multiblock may be put to use also for generic menus.

agentrickard’s picture

Custom menus and blocks for each site are not a built-in feature. If the documentation suggests that they are, please add a note to #370812: DA Documentation Updates & Advanced Help Implementation

Domain Blocks -- http://drupal.org/project/domain_blocks -- is recommended for block handling.

Menus are much trickier. You can set primary and secondary links per domain using Domain Conf. Also note that node-based menu items are subject to node access rules, so they can appear to be custom per domain.

The general solution for custom menus would likely be to create a menu block for each site, and then use Domain Blocks to show/hide it appropriately.

Anonymous’s picture

If you go to http://drupal.org/project/domain and look at the Domain Menu under Contributed modules, you'll see how I got the impression that customized menus for sub-domains was built-in to the current version of Domain Access.

The Domain Blocks module will be helpful in the future I'm sure. However, it doesn't quite accomplish what I need. I've ended up creating a compromise between what's needed and what can be done. Having to compromise with software (letting it control me) is something that doesn't set well with me. I'd like to see this become built-in or a module that adds this functionality.
The reason it doesn't work in my case is because I'm using a layout where the primary links block isn't being used. The items that would be in the block are displayed in a vertical tabbed menu across the top, like you see here in this forum (Documentation, Download, etc.).

I was unable to completely follow the suggestion from skizzo. I'm sorry, but I got lost after: .../conf/DOMAIN-ID, Menu Settings fieldset.
If this is a solution for what I need to do, I'd appreciate a little more hand-holding as I've only been using Drupal for a few months.

I also don't have much money, but if someone wanted to develop this module for customized menus, I'd be interested in hearing how long it would take and how much they would want.

Thanks for the help.

agentrickard’s picture

"Having to compromise with software (letting it control me) is something that doesn't set well with me."

Please mind your tone.

This is free software with an open API. The software does what people have asked it to do, within the limits of time. (This is true of all Drupal, in fact.) So that attitude will only lead you to frustration, while turning away people who might help you.

Menu handling is _extremely_ complex. You can try table prefixing (using Domain Prefix), but it can have unpredictable results.

There is a thoroughly documented API for Domain Access. If the API does not support the functions you need to hit your target, then the API needs to be expanded.

Anonymous’s picture

I apologize for the misunderstanding of my statement. I assure you, it's quite positive, not negative. I was attempting to convey the point that this is something that would be a welcomed edition to the Domain Access module. So, what's it going to take to get the job done? Where I come from that is considered a positive characteristic.
I don't have the technical ability to do such a thing. My job is strictly a donation payment job. So, I have little money. I'm interested in finding people who are willing to work on this. If I'm able to raise money to fund the effort, I'm glad to help.
So, who is already working on this? Or, who was planning on working on this? Or, who is willing to work on this with a little financial incentive?
Reiterating my previously misconstrued attitude: let's not be satisfied with work-arounds. If others think this to be a valuable addition to the project, then let's find the people willing to do so. This is the only place I know to start. If people feel this is a waste of time, then I suppose this thread will die.

markus61’s picture

hi,
thanx for this great set of modules!!! i stumbled upno them while trying to accomplish the goals described here http://drupal.org/node/372672. i put down that whishlist without knowing about the domain access suite - and bingo there it is ;-)

while i guess this is not the right place to discuss i still would like to say that i would love to contribute to any work leading in the direction outlined in my whishlist. and yes, domain specific menues should be part of it.

cheers,

/markus

agentrickard’s picture

Component: - Domain Nav » Code
Category: support » feature
Status: Active » Postponed

I suspect this will get done at some point, when one of our clients asks for it, but I don't have time for it right now.

I probably already postponed a similar issue once before, which is why Domain Menu exists.

Anonymous’s picture

I wasn't aware of the Domain Menu module. I always filter for 6.x. So, the next step is how does someone obtain the programming to the module? Sorry is this sounds dumb, but I'm not a programmer. I have a friend who's going to introduce me to someone who might have the ability to make modules. I'd like to get him or someone to finish this module.
The next question is where on Drupal.org do people advertise for someone to program a module or do other work?
Thanks for the help so far. It looks like we're making progress.

agentrickard’s picture

See the Handbooks.

http://drupal.org/handbooks

hailaz’s picture

I was also under the impression that the menus could be unique per subdomain. I would like to contribute to this new function but am not a php writer. Sorry to bring this to the top again but I think it's important.

agentrickard’s picture

Version: 6.x-2.0-rc5 » 6.x-2.0-rc6

Primary and secondary links menus can be unique per domain, using the Domain Conf module. (Of course, you have to set up those menus.)

The Domain Menu module also tries to solve this problem. You can also create separate menus and use Domain Blocks to divide their output by domain.

This feature will best be supported by another module, not the DA core, which is too big already.

hailaz’s picture

Thanks for replying.

I am using domain_user, is it possible to make a menu for all new subdomains as they are created or do you have to allocate one per domain after registration? I'm trying to automate as far as possible and domain_user is excellent for that.

Would you know of anyone that would develop this as a new module? I am more than happy to pay for it but it's going to need to be done over the next couple of weeks.

Edit - I am trying out the domain primary links but the problem is the editing of pages and links are showing site wide, not to the specific subdomain. I've sorted the settings for that including view domain publishing but it's not happening.

agentrickard’s picture

If you send me a private message, I can give you an official services quote.

'view domain publishing' is overruled by 'set domain access', so if you have both permissions, the greater permission rules.

donkasok’s picture

hi,

Use domain access module.
It's easy to set up and easy to follow up.
It allow you to have each subdomains have their own theme.Here we need to play smart.Coz domain access allow only one installation of modules,Which means you have all your modules are in module folder.
IF u r using DHTML Menu module for modules or any other menu module, take the css out from the folder and insert it in theme folder,u can also put it in theme css file.

So every time u access a sub domain, The meu will look for its css and it will call it from thetheme dynamically.

cheers,
Don

bartezz’s picture

Sorry to start in an old issue, but I was pondering.

Table prefixing of tables menu could be an option.
But would this admin/build/domain/batch/menu_primary_links_source still work?
This is default set to primary-menu, but will it pick up the primary-menu from the subdomain's prefixed table? Or do you still have to set this by hand?

Hope you understand what I'm trying to say here!

Cheers

agentrickard’s picture

Table prefixing the menu_* tables is a bad idea. The menu system respects node access, so you can either have one menu filtered by access, or set up a menu for each domain and use that setting (and the Domain Primary Links block).

bartezz’s picture

Alright thanx!

rajbunny’s picture

Title: Sub-Domain Custom Menus » Table Pre-fixing
Component: Code » - Domain Prefix
Category: feature » support
Status: Postponed » Active

Apologies, in advance if this is the incorrect forum for my question - if i am posting in the wrong place and you know where I should be posting a url directing me to the correct forum would be appreciated.

I have two domains, let's say raj1 and raj2 - set up using domain access - works great (thanx). Then - when setting up user roles/permissions - i noticed that, regardless of user role/permission, the book outline and menu structure of all domains are visible to all domains when adding new content in the menu/book outline down selectors.

I decided to try use table prefixing to isolate the node/block/menu's etc per domain. I have made copies of these tables using the Table Prefix module - and it would appear based on the user interface for this module that tables have been copied (from raj1 to raj2). My dilema now - how do i view/access the copied content for the second domain(raj2) - for example when looking at affiliate content there are 35 articles listed under raj1 and 0 articles listed under raj2 - the user role i am using has full access to both domains.

the only changes made to my settings.php was the a single line added when installing domain access i.e.
include './sites/all/modules/domain/settings.inc';

Furthermore I have retained the following line of code in my settings.php i.e.
$db_prefix = '';

I am not sure this is correct or if it is the reason I can not "see" the copied data - the table prefix install.txt is a little ambiguous - suggesting that we DO NOT USE THE $db_prefix variable - and then suggesting that it "should still work" if $db_prefix ='string' - no sure what ther correct course of action should be i.e
1. should I comment it out,
2. leave it as is i.e. $db_prefix = ''; or
3. should i set it as follows: $db_prefix ='string'

agentrickard’s picture

The module determines the proper $db_prefix for you, so that should not be a problem. If you are running multiple sites (not just the one DA site) on a single database, you might use a global $db_prefix like 'site1_', which should work fine.

The data from a prefixed table is loaded when you are on that domain. The problem may be that books, et. al. use node ids, and that could cause all kinds of weirdness. You would need to save the book changes _on the domain you want the data stored_.

To test, look for a table named something like 'domain_2_book' in your site. If you don't have access to MySQL, get the TableWizard module and use it to look at the data.

rajbunny’s picture

Thanks for your reply, although I'm still a bit confused i.e.

lets say i have 2 sites:
1. raj1.example.com
2. raj2.example.com

With regard to the $db_prefix -
Yes - I am running multiple sites (not just the one DA site) on a single database, and I am using Table prefixes - I checked the database and yes my copied tables are all there and prefixed as "domain_2_"

in my settings.php should I:
1. comment out the line $db_prefix = ''; OR
2. leave it as is i.e. $db_prefix = ''; OR
3. be adding code of some sort to indicate the different domains and their table prefixes

then, with regard to "The data from a prefixed table is loaded when you are on that domain" - when i login to the second domain (with a user that has full rights on both domains) -

I noticed that changes to user permissions on raj1 were NOT replicating to raj2 - it dawned on me that i had copied the user tables to raj2 - i can see how the table prefixing would work on the user modules - so far so good (i have since dropped the user tables on raj2, as duplicate users/roles are not required at this point in time)

Then attempts to edit book/node/content on raj2 and save it are replicated on raj1 (and visa versa)- they still appear to be sharing content instead getting content from separate tables

also - my book/content menu links point to raj1, although the site navigation/administration links point to raj2. IF I edit an article while logged into raj2 - the menu item for that node updates to point to raj2 but other node links remain linked to raj1, AND ...the changes to the node and its menu link is ALSO applied to raj1 - indicating they are still sharing the same table.

How do i get these 2 domains to load data from their respective tables and stop sharing content?

I'll keep muddling through this, as i have to get it up and running today - however if there is any further documentation on how to use table prefixing other than the readme.txt and install.txt - I would appreciate a url.

thanx in advance

agentrickard’s picture

If you want totally separate content, Domain Access is not the right solution.

If you are running multiple sites on one database, I would expect that each site has its own $db_prefix. In this case, if you installed the DA site _with a prefix_, then $db_prefix should be set to that prefix string. That is:

1) You installed the DA site with table prefix 'example_' during the installation process.
2) Your domain tables (and other core tables for the site are example_*)
3) You should set $db_prefix = 'example_' in settings.php, as normal.
4) Your prefixed tables should be named 'example_domain_ID_*'.

As for the other issues, I suspect you are not prefixing the correct tables. Domain Prefix is provided "as is" and you have to figure out which tables need duplicating on your own.

agentrickard’s picture

Status: Active » Closed (fixed)