By Flplsx on
The user sets their location (taxonomy) upon setting up their profile. When a user creates content of a certain type, I'd like to pull in their location to the content automatically.
In other words, a user assigns a taxonomy term to their profile. I'd like this term to be assigned to each piece of content (of a certain content type) they create and have this term visible on the content's node.
I'm sure the answer is somewhere on here, but I've had no luck finding it. Thanks in advance!
Comments
Automatically assign taxonomy term
Hi,
You might be in luck and be able to do this with the Taxonomy Defaults module - http://drupal.org/project/taxonomy_defaults. I say might because, although the module allows you to assign default terms to nodes when creating/editing them, I don't know whether you can pull the default term from a user profile. You'll have to try it and see.
Otherwise, assuming the user location is loaded in the global $user variable, you could hook_form_alter the taxonomy select on the node edit page in a custom module.