0

I'm sure I used to know how to do this, but now I can't work it out.

I have a content type, lets say it's called "project". A project can have multiple contributors, and for each contributor I need to have two fields, let's say "Name" and "University". Can I set this up as a single Content type?

If not (and I have to have a Content type for the project and a Content type for the contributor, using entity reference to link them), then how do I set it up so it's easy to edit on a single page (i.e. create a new project, click something to add another contributor on the same page)

  • You can do that with something like Field Collection, but from best-practice point of view it would be better to put the fields on the entity they belong to (user). You could use Entity Reference along with Inline Entity Form to allow editing on a single form – Clive May 8 '15 at 8:52
  • Thanks Clive. I will look at Inline Entity Form - that sounds like what I need. – James May 8 '15 at 9:01
1

I'd recommend keeping the contributors separate with their own fields. In order to edit them on the one form you can use a number of different modules. We use Inline Entity form. https://www.drupal.org/project/inline_entity_form

  • Yes, this is what I have done. – James May 11 '15 at 9:06
0

If you have fixed contributors then create two fields for each contributor:

field_1_contrib1  
field_2_contrib2

Then use field_permissions to assign appropriate perms for those fields.

To show author of each field, you can theme each field in the preprocess function in template.php or create a field.tpl.php file.

  • No, there can be any number of them. – James May 8 '15 at 8:22
  • Then better use separate table to maintain their data. – AgA May 8 '15 at 9:07
  • A separate Content type you mean? – James May 8 '15 at 9:13

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.