Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I want to customize the user-edit page. So in my template.php in my custom theme i direct Drupal to look for my custom template as:

function mytheme_theme() {
return array(
// The form ID
'user_profile_form' => array(
// Forms always take the form argument.
'arguments' => array('form' => NULL),
'render element' => 'form',
'template' => 'templates/user-profile-edit',
),
);
}

This works fine as Drupal is able to pick my custom user-profile-edit.tpl.php. Inside that file i have rendered some elements as :

<?php

print render($form['form_id']);
print render($form['form_build_id']);
print render($form['form_token']);

print render($form['field_birthday_user']);
print render($form['field_real_name_user']);

And so on.I have two questions...How do i get the user picture field, username, password, and email id fields to edit and how do i get to save the profile, i.e., how to get the save button. For the first part i tried doing:

print render($form['account']);

However, this does not displays the user picture.

For the second part, i tried doing this :

<input type=”submit” name=”op” id=”edit-submit” value=”Save”  />

at the end of my custom user-profile-edit.tpl.php. However i get an error regarding syntax.

Would appreciate any suggestions especially regarding the user picture thing.

Thanks

share|improve this question
    
what i need is something along the lines of this question:drupal.stackexchange.com/questions/63504/… –  why Mar 5 '13 at 9:57

3 Answers 3

up vote 1 down vote accepted
print render($form['picture']);

Yups..thats all that is required...but i am still stuck at that save button...i have used, for the time being,print drupal_render_children($form); to get the save button..if someone can suggest how to do this by code then i would implement it

share|improve this answer
    
the standalone submit button would be something like render($form['submit']) . Tip: use Devel module and dpm($form) and the form array becomes easy... –  Pan Chrono Mar 5 '13 at 12:32
 print drupal_render($form['actions']); 

that should output the save button

share|improve this answer
    
Read How do I write a good answer to a question? meta.stackexchange.com/q/7656 –  Nikhil M Jun 19 '13 at 13:27
print drupal_render_children($form);

will take care of the hidden and submit inputs. Try to print_r or dpm() your $form to render the other fields.

or if you use profile2 module this could be handy http://thanhsiang.org/faqing/node/178

share|improve this answer
    
hi...thanks for the prompt reply..FYI i am not using profile2...just adding custom fields –  why Mar 5 '13 at 9:41
    
hi...how do i get only the user picture form...i want it to be placed at the beginning so ... –  why Mar 5 '13 at 9:46
    
what i need is something along the lines of this question drupal.stackexchange.com/questions/63504/… –  why Mar 5 '13 at 9:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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