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 !

| improve this question | | | | |
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

| improve this answer | | | | |

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.