Add posting username to taxonomy list automatically
nicholas.alipaz - February 25, 2009 - 05:56
| Project: | Author Taxonomy |
| Version: | 6.x-1.7 |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Robbie Sternenberg |
| Status: | closed |
Jump to:
Description
I request the option to add the posting user's username to the author list automatically on opening the posting form.

#1
I have added a hook_form_alter(), in a module I made, to my posting form for the time being:
<?phpfunction mymodule_form_alter(&$form, $form_state, $form_id) {
if ($form_id == 'my_formid_node_form') {
global $user;
if (!$form['taxonomy']['tags']['8']['#default_value']) {
$form['taxonomy']['tags']['8']['#default_value'] = $user->name;
}
}
}
?>
Still, would be a nice feature to add.
EDIT: added a quick if statement (line 5) that checks to see whether the field is empty before filling it in. Otherwise it wipes out any old values one might have.
#2
Added this feature. Thanks for the suggestion.
#3
thanks for the addition. I will grab the new version soon!
#4
Automatically closed -- issue fixed for 2 weeks with no activity.