0

Hey Guys I hope you can help!

In short: User Profile fields should be exported to certain parts of the add new page fields, Text and Taxonomy Terms

For example, User profile will have 2 html codes for pictures and 3 taxonomy terms or just the text and these fields need to be filled in automatically inside node creation so the user doesn't need to do this and all goes well. User should not be able to edit or change it as well.

I don't want users to fill in the following things on node creation since it only makes things complicated for them. But it needs to be different for each user and it needs to be done for every node or else things will get displayed on the wrong pages. So I want to set it up once and then it will be automatically filled in the rest of the times. I think its easiest to have this information stored in the user profile which they get after I create the account for them. They don't need to see this and Drupal should pull in the information from the user profile. But how

  1. text field which will need an image html code which is the same for every node of this user displays a small image for the view that shows up in the panel. (so its needs to be filled every single time with an image link)
  2. text field which will need an image html code which is the same for every node of this user but this one display a bigger image for the node. (so its needs to be filled every single time with an image link)
  3. Taxonomy Term 1.
  4. Taxonomy Term 2.
  5. Taxonomy Term 3.
  6. Text user can fill in
  7. Another text a user can fill in.
  8. Date field a user needs to fill in.
0

In broad strokes, you could intercept the node edit/add form via hook_form_alter() to remove the fields from the form and then you could implement their population via the hook_node_presave() to grab all the information from the node owner's profile and save the fields in the new node.

Caveat: if the user can change this information in his/her profile, it won't automatically update any of the node fields unless you add in that logic as well on the saving of this new information to all the nodes already created.

  • Ok i am trying to get this done. My god dont have any idea how to do this :) Thanks for the reply – roman Oct 29 '13 at 15:55

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.