0

I create a template called page--user--edit.tpl.php

Into that file, I want to display some inputs for editing like username and password only, not the default edit form.

I don't know the code to put into this file for displaying only these input.

Thanks for your help !

1 Answer 1

0

Use Hook form alter and find the id of user edit form. Unset all extra fields but username and password. In templates it is not recommended to add php. If you want to disable or hide something its better to disable it from the render array. here is an example:

<themnam>_form_<FORM_ID>_alter($form, &$form_state) {
 dpm($form);
 unset($form['your-field']);
}

I hope it helps

Your Answer

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

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