We have themed the user registration page by hook_theme() as follows

function ourmodule_theme(&$existing, $type, $theme, $path) {
  $hooks = array();  
  $hooks['user_register_form'] = array(         
       'render element' => 'form',
       'template' => 'user-register-form',
 return $hooks;

This is getting reflected in the user creation page when we log in as admin as well. We want to use the custom template only for anonymous users. How can we do this? We prefer to do it via module itself.


You can use the role based theme switcher module. It allows you to switch the whole theme. If you only want to change one template you can use this thread.

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.