I have been trying to create a template to control the user login block given in Drupal 7. I've referred to the template suggestions documentation page and have tried block--user-login.tpl.php, block--user.tpl.php and am getting no love.
What is the template name for the user login block?.

  • Ok, figured this out (with some help) The actual template name is block--user--login.tpl.php (need two dashes between each)
    – jive
    Apr 22 '11 at 17:05
  • You should write that as answer, and accept it. It doesn't increase your reputation, but it increase the number of answered questions, which is one of the parameters they check when they decide if this site can continue. If you this, I will up vote your question. :-)
    – apaderno
    Apr 22 '11 at 20:17
  • Didn't I answer this in IRC? Apr 22 '11 at 21:17
  • yep. you sure did. I posted this before that.
    – jive
    Apr 24 '11 at 6:31

Since I answered this in IRC, I'll rewrite the answer.


The easiest way to find all of the possibilities for naming template files is to put print_r($variables['theme_hook_suggestions']); at the end of your theme's template_preprocess_HOOK(). Doing so works great for block, node, page...

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.