0

diving deep into Drupal 7 as a noob and wondering how can I create a field (select list) in a new content type that pulls in all the users in the system? I'd like to be able to associate certain content with a person, not necessarily as the author, but as the "person in charge of this area" for example. I'd like to show the persons name and some other info from the "people" area of the Drupal 7 core.

I am thinking I should use the people area rather than create a new content type for people. I added new fields to the "new user" form.

Any thoughts or ideas?

EDIT:::

Did find https://drupal.org/project/references module that seems to work great. However, I still would like to know if using People area is best for storing all users / people associated with my Drupal site. Thanks :)

2

Personally I often use Entity Reference, but I think this answer is the same regardless of the choice between Entity Reference and References modules. Both modules allow you to define a relation between two entities. If you need a reference from a node to another entity, this is a good solution.

I still would like to know if using People area is best for storing all users / people associated with my Drupal site.

When you say "People area", I think you mean Drupal's built-in user management. Users are fieldable entities, just like nodes. If you need to store data about a person, you can use both the user entity or define a "Person" node type. If the persons you're adding should be able to log in, now or in the future, you definitely want to create users. If they will never need to log in (for instance, you're building a site about people in ancient Rome), I would choose nodes.

  • Thanks for the reply! I would like the ability for them to login possibly, so I'll keep going about it with the built in user-management area. The user reference module doesn't give me the persons first / last name... only their username. I'll give the entity reference a shot! – jasonflaherty Mar 17 '14 at 20:31
  • Entity Reference lets you use a view as source for the select box, and you can use the fields on that view to control which label the user will see. If you must, you can even go more advanced with a module like Entityreference view widget, see also drupal.stackexchange.com/questions/24559/…. – marcvangend Mar 18 '14 at 8:11
  • 1
    Entity Reference is a killer module. WOW. I've done just what I needed with it. Thanks! – jasonflaherty Mar 18 '14 at 14:43

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.