I have a process of adding contents where user1 has to search for user2, when user2 is found, there is a button that adds a specific content type (i.e. "Create a report for this user") for the searched user. then it goes to a page where i can enter information and save the content. how can i do this?


Your user selection/search process may need some custom work to implement the various node-reference modules in the way you've described, but there are several modules that may do what you need out of the box. The References module will be easier to implement while creating new content, but the Relation module may be more agile as you can add fields to your relations, 'user report' for example.

I would be happy to elaborate if you'll clarify your user selection process.

1 - References

This adds a field to an already created content type. Generally simpler to implement.

This project provides D7 versions of the 'Node reference' and 'User reference' field types, that were part of the CCK package in D6, at functional parity with the D6 counterparts. See http://drupal.org/node/533222 for details.

Video Series (NodeOne) Using the Reference module

2 - Relation

Rather than being a 'field' on an already created content type this is for all intents and purposes a new content type. Relations are fieldable as well, so adding the 'report' fields you need will be easy.

Relation is an API module and storage model for both simple and the most complex relations between entities. The module can handle both directional and symmetrical relations very well.

Video Series (NodeOne) Learn the Relation Module

  • Thank you! Please bare with me because I'm really new in drupal. OK, i'll explain it to you the selection process. – leo tan Sep 17 '12 at 5:44
  • There are 2 user roles:lender and borrower. Only lenders can search for borrowers. These borrowers has custom added fields in the user profile which are types of IDs(ex. driver's license). These fields are individually made... So, there would be a block or page where the lender can enter an ID no. and choose what type of ID to search of a specific user. Then if found, limited user information will be shown with a "Create a report for this user" button. Then the lender submits/add the report(this is a custom content type). – leo tan Sep 17 '12 at 5:54
  • Using Drupal's built in search functionality, or even the Views module could here. Are you comfortable enough with PHP to do custom coding or would you like to stick to contrib modules where possible? I'll try to update my answer accordingly. It sound's like Drupal is the perfect tool for this job. – Citricguy Sep 17 '12 at 23:01
  • I like to user contributed modules as much as possible. Im not good in PHP too. Im trying to use views, the problem is the dropdown box with ID types to add the filter for users. – leo tan Sep 18 '12 at 10:52
  • Your links don't seem to work – callmebob Aug 6 '16 at 12:00

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.