I'm building a site that includes a business directory. Here are a couple issues that come to mind:

Each user can belong to one or more company. Likewise, a company can have many users linked to it.

You'd need to avoid the creation of multiple profiles for the same company. You also want to grant only certain users permission to edit a company profile.

I'm thinking I need to create a "Company Profile" content type. As a minimum, I'd be happy to give users the ability to select their company and then show a link (or links) on the user profile page to companies they are associated with.

Any suggestions?


nevets’s picture

I would consider using the flag module, it would allow users to flag which businesses they are associated with and you could use a views block to display which businesses a user is associated with.

johnhorning’s picture

Thanks for the great suggestion! I've implemented this already.

zilla’s picture

here's how i'd do it:

there's a company content type - maybe only you can create it, or select users, i have no idea.

you have a user profile that contains a field that is an entity reference and it references the bundle 'company' (content type)

a user fills out a profile, then uses the autocomplete to start typing in their company name and voila, it appears

now you have to show the link on the company page back to the user who linked to the company. one robust yet easy way is to use views and EVA module (entity views attachment). create an EVA that appears on the nodes of content type 'company' and pulls from the entity reference field that those same users filled out.

sound confusing? it sort of it is, but follow the link to https://drupal.org/project/eva and then on that project page, follow that link to the video tutorial that shows you how to basically what i just described.

i love to waste time: http://twitter.com/passingnotes