Is there a way to set up domain access to allow a different user profile per domain?

For example, I have domain1.com and domain2.com on domain access.

I have a node reference (lets say its a favorite color field) in the user profiles settings. I only want that node reference to show up on registration for domain1.com and on user profiles for domain1.com. Right now, it is showing on all domains. So when a user registers for domain2.com, they are asked what their favorite color is (node reference) even though that has nothing to do with the data on domain2.com.

Does this make sense?

Is this possible to do?

CommentFileSizeAuthor
#7 963340-user-argument.patch2.39 KBagentrickard

Comments

btweedy’s picture

Component: User interface » Miscellaneous
agentrickard’s picture

You would need custom code. Theoretically, you could use Domain Prefix on the profile tables, butthat sounds like a bad idea to me.

kmajzlik’s picture

Please can anybody give me some idea how to start this?
I have a domain access module because of some other things/domains. Now we need user-name.domain.net to be a user's profile page. But i do not want to have there normal user/UID page(but it can be, i can override it), it can be a views page(+ views blocks like blog, galleries etc.), but can't get working...
I use Content profile so this should be good to use somehow with argument in views...

Or have i to create own module?

agentrickard’s picture

You have to create your own module to handle the domain negotiation.

The Subdomain module does something similar. If this is the only domain-related feature that you want, then Domain Access is not the proper choice for you, unless you use Domain User and set the homepage for each domain to be the View or other page callback you want.

kmajzlik’s picture

I do not want Subdomain because i have Domain Access, very useful module!

I think this is my way as i tried somethings: Domain User, set some view (page display) as homepage for default domain. Ok, but can somebody tell me how to set right argument(how exactly to set path and argument) for that view? I tried many options but still can't get the right one. Just need user or content profile of user to be a result of View.

kmajzlik’s picture

hm... tried more things and read more documentation, it seems i'm going out from view with path to own module using:

global $_domain;
$_domain['uid'];

to identify user.

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new2.39 KB

No argument handler exists for that. You would need to write one. What you want is the user id of the user who "owns" that domain, which can be derived from the {domain_user} table, but that table is not exposed to Views.

I believe you need a new "default argument handler" for the UID argument that lets you define "use the user id of the owner of this domain."

I think the attached should work. Put the patch in the /domain root directory and run:

patch -p0 < 963340-user-argument.patch

It should add a new folder /domain_user/plugins and two new files.

barry_fisher’s picture

We've just created a module for domain level profiles. It essentially extends the admin user interface to allow checkboxes for each domain per profile field and then filters them on the front end. It was literally built this afternoon so I'm still polishing it off. Anyone interested in this if I contrib-it-up within the next couple of days!?

kmajzlik’s picture

sure!

barry_fisher’s picture

@karlos007 Ok, you asked for it.

Domain Profile module in alpha-ish state although it works very well for me. I would like to get some feedback/issues placed before making it a full project (application is pending) and approaching @agentrickard for possible core domain access integration.

Thanks,

Barry
Real Life Design

kmajzlik’s picture

i will try it during this week and report, thanks a lot!

agentrickard’s picture

Please add here if you haven't already: http://drupal.org/node/1068570

barry_fisher’s picture

@agentrickard is it appropriate to add a sandbox project on that contrib page, or shall I wait until the application process completes to make it a full project?

I don't know how long the application process takes exactly. It's here: http://drupal.org/node/1125522 if there is anything you can do to move it along??... or is granted full project access reserved to a subset of Drupal devs? Anything to get the ball rolling would be great.

Excellent to see so many contrib modules coming about for Domain Access. We are currently working on a project using Ubercart and Domain so I'll be putting up some other modules soon, as it's an area where there could be more work. Specifically, I'm currently building a module to override Ubercart Product Prices per domain.

agentrickard’s picture

Status: Needs review » Closed (fixed)

I think we approved you this morning :-).

Sandbox projects are fine, but should be labeled as such.

You should look to Ubercart Domain Access and try to integrate support there.

barry_fisher’s picture

I've added domain_profile to the DA contrib list now. Thanks for your help in approving the module and my git access. The module has now been promoted to a full project and I've put it out as a beta-1 release until I get some initial feedback/issues. It's working well for us here.

I'm currently working on an ubercart prices overrides modules so I'll release that once it's done. The current Ubercart Domain Access module is focussed on orders (I remember from looking at it). Ubercart is structured into several sub modules for better maintainability. By extension I think it makes sense to mirror these UC project names prefixed by domain_. I have called the module "domain_uc_product" which domain access enabled the uc_product module.

Cheers.