1

I have made a custom template for the user_profile_form. I made a module and in the module I added the hook_theme function:

function myuser_theme() {
  $items = array();

  $items['user_profile_form'] = array(
    'render element' => 'form',
    'path' => drupal_get_path('module', 'myuser'),
    'template' => 'user-account-form',
  );

  return $items;
}

This works as suspected but the theme is also applied in the administration theme. How can I have a custom template for the profile form and retain the original layout from the administration theme?

0

You can sniff the user's role and/or permissions and then conditionally change the template.

You can test permissions with user_access('view the administration theme') and depending on the result, assign your custom template.

| 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.