0

I have an existing content type in my current Drupal application, person. This contains all of the data you would expect, more or less - name, address, employer, etc.

I'd like to create a project content type. A project will consist of a name, description, and multiple members. Each of these members should be a person node that will already exist. It would be great if I could have the ability to add members by either selecting from available persons as a dropdown, or maybe some sort of autocomplete on name. I already know how to do autocomplete, but the issue then is that the field will be autocompleting just the person's name. I need a project node to actually contain multiple entire person nodes, so that I can get ALL of the info out of them - name, position, etc. etc. Is this sort of functionality natively in Drupal?

Alternatively, I could implement hook_node_load in this module, and add person nodes to any node loaded that happened to be a project node. Would this be a more viable alternative?

0

In future it would help to know what version of Drupal you are using.

In D6 you can use Node Reference CCK field, which creates a cck select list, auto complete, radio buttons or checkboxes listing the node types you have selected to be referenced.

There you could use your autocomplete form, type the users name and add them to the project.

This module however no longer exists in D7, instead have a look at these modules which could do the same or similar:

http://drupal.org/project/references

http://drupal.org/project/Relation

http://drupal.org/project/entityreference

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.