I have a block view in the header. The suggested tpl files are block__mens_header (block--mens-header.tpl) as well as node--mens-header.tpl For some reason the more general tpl files are working but I need to get specific here. Is there a preprocess function I need before these will be seen?

  • Got node--mens-header.tpl to work but the block still isn't...? Dec 24, 2011 at 23:06
  • Did you configured the block visibility setting to appear in some specific page(s)? Did you try to clear your cache as well? Dec 26, 2011 at 2:06
  • The block is visible and i did clear the cache plenty of times. Dec 26, 2011 at 3:03

1 Answer 1


I seem to remember, in drupal 6 at least, that you need to have block.tpl.php there, even if you don't modify it at all, in order for the specific block templates to be seen.

ADD: If it's in there, you might try a preprocess_block() hook with something like:

$variables['template_files'][] = 'block--mens-header';

stuck in it. This should point it to block--mens-header.tpl.php in your theme directory. Obviously, wrap that in some logic so it's only set for the block in question.

  • I do have the block.tpl file in the dir. Not sure what else could be the problem. Dec 25, 2011 at 20:13
  • is this for drupal 7 or 6? I am using 7. Also can't say I know much PHP so what logic do I need...? Is there documentation I can read on this? I am trying to learn.Thanks Dec 26, 2011 at 3:01
  • I don't know enough about d7 to rattle something off right here. I'd suggest digging through drupal.org's documentation (A good start is drupal.org/theme-guide/6-7 ) or grab a good book. It's pretty straightforward, but also complex, all wrapped up in one :)
    – Jimajamma
    Dec 26, 2011 at 4:07
  • oh...and make sure you clear your caches often....
    – Jimajamma
    Dec 26, 2011 at 4:13

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.