0

I have a custom content type "Holiday". There is role for users, "Sponsors". Only the sponsor users can create this "Holiday". "Holiday" has many fields. Three of them are:

  1. Sponsor Name
  2. Sponsor About
  3. Sponsor image

Also users have fields as name, about and image. Now i want that when a sponsor user is logged in and he/she creates a "Holiday" then the above three fields, i.e, 1. Sponsor Name 2. Sponsor About 3. Sponsor image are automatically filled in from the Sponsor user profile information, ie., Sponsor name is automatically filled in as the user name (who is logged in and creating the "Holiday"), Sponsor about from the User:about and Sponsor image from the image field provide for user. How can i achieve this.

Any suggestions?

Thanks

1
  • how can i do that in panels ...as i am already overriding it using panels and cannot change it now...its in production –
    – user145078
    Mar 27, 2013 at 10:07

2 Answers 2

1

use the form api and hook_form_alter http://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_form_alter/7 and set the values of the form items to the items you specify WIth form api you can specify a default value which you can set to what is in the user profile.

2
  • i will have to write a custom module for that then? and it wont effect my panel settings?
    – user145078
    Mar 27, 2013 at 18:39
  • I would create a custom module yes. Apr 1, 2013 at 13:48
0

First of all, sponsor should be a node author. So you don't need to store any additional fields in node, just override node--[type].tpl.php to display author fields.

1
  • how can i do that in panels ...as i am already overriding it using panels and cannot change it now...its in production
    – user145078
    Mar 27, 2013 at 9:56

Your Answer

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

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