I have a CMS to which many people can possibly provide data. So, I would want to include all the users who have contributed the data for a node by adding new data or moderating existing data, because everyone who contributed for a node deserve themselves to be undersigned. Right now, only the first person who creates the content would be the rightful author.

How can I achieve this?

I have googled but could not get much help. The closest I could find was this, which still goes unanswered. I have checked Entity Reference module but I could not get it to auto-fill the author whenever a user edits an existing node.

I have automatic revisions enabled, which means I do have the information of each author for a node who have contributed. But how do I pull each author out of the revision information and display the collection of all authors & contributors in a nice manner at the end of each article?

Please help me find a solution, I am not that well versed with PHP programming.

Thanks & Regards,
Raj Pawan G

2 Answers 2


I accomplished this by the following steps:

  1. Download and enable the Rules module and the Entity Reference module.
  2. Add a field called "Foo" to your content type. Field type: Entity Reference. Target type: user.
  3. Create a new Rule.
    1. Add event: "Before saving content"
    2. Add condition: Data comparison. Parameter: Data to compare: [node:type], Data value: bar (Where "bar" = your content type's name)
    3. Add action: Add an item to a list. List: [node:field-foo], Item to add: [site:current-user]

Now every time content is saved, the user who saved it will be added to the list of editors of that page.

  • Awesome answer! It is almost perfect, but at the end I would want to show the User's name who contributed, but what is displayed is the User's history, "about me" etc. which are configured in the Configuration->People->Account Settings->Manage Display. How do I fix this last thing? Thanks a ton! Commented Nov 21, 2012 at 18:39
  • Change the display mode on the "manage display" tab of the content type settings.
    – beth
    Commented Nov 21, 2012 at 19:54
  • Awesome, I should have checked that! Accepting your answer. Well one more thing if am not asking for too much! Username is sort of cryptic, so I have added a display name to the users fields and marked it as required field. Now instead of showing this username, is there a way to show the display name instead? I tried a lot but could not find any options for that. Commented Nov 22, 2012 at 5:43
  • Also small correction, please change your 3.2. from Add event to Add action. Commented Nov 22, 2012 at 5:45
  • Changed. I don't understand the question in your previous comment.
    – beth
    Commented Nov 26, 2012 at 16:38

Here is a custom .module that does the task for a content type called wiki_page. The content type has a multi-valued text field called field_editors. Put field_editors on a display mode, and the list will appear. No Views work needed.

/** * @file * Keep track of the users who have edited a wiki page. * * @todo Check whether the page content has changed. */

/** * Implements hook_form_FORM_alter(). */ function cyco_remember_editors_form_wiki_page_node_form_alter( &$form, $form_state ) { $form['#submit'][] = '_cyco_remember_editors_wiki_submit'; $form['field_editors']['#access'] = FALSE; }

/** * Add current user to list of editors if not already there. */ function _cyco_remember_editors_wiki_submit( $form, &$form_state ) { global $user; //Editor is current user. $editor_name = $user->name; //Flag to show whether the editor is already in the list. $editor_in_list = FALSE; $language = $form['#entity']->language; $num_editors = 0; //Are any editors listed? if ( isset($form['#entity']->field_editors[$language][0]['value']) ) { //Yes - see whether the current editor is already in the list. $current_values = $form['#entity']->field_editors[$language]; $num_editors = sizeof( $current_values ); for( $index = 0; $index < $num_editors; $index ++ ) { if ( $current_values[$index]['value'] == $editor_name ) { //Editor is already listed. $editor_in_list = TRUE; break; } } } if ( ! $editor_in_list ) { //Current editor is not in the list. Add him/her. $form_state['values']['field_editors'][$language][$num_editors]['value'] = $editor_name; } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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