I just created block-menu-primary-links.tpl.php file in the root of my theme, in order to strip off some default structures I have for other blocks, but now that I did that, block-edit-link which was displaying itself by default on hover, doesn't appear anymore. It's not that I want it to back, but I just wonder why did it go away and how can I control it?


Here is what I have in my block-menu-primary-links.tpl.php:

<div id="block-menu-primary-links">
    <?php echo $block->content; ?>

When I inspect html structure after it is rendered I see that contextual links are in there, but hidden and obviously block has lost something that made the logic tick.

  • How did you override the template? If the primary links are rendered as a block then the contextual links will appear. If you use some other method to render the menu without putting it in a block with block markup then the links will not show.
    – Adam S
    Commented Jun 26, 2011 at 7:33
  • I've updated my question. Sorry for being not specific, I'm still not touching the Drupal ground.
    – jayarjo
    Commented Jun 26, 2011 at 9:01
  • For whatever reason, they are in my case, if by contextual links we both understand a little menu with actions to edit and such.
    – jayarjo
    Commented Jun 26, 2011 at 9:50

1 Answer 1


Ok, tracked down the reason - every block requires to have a className of block:

<div id="block-menu-primary-links" class="block">
    <?php echo $block->content; ?>

Once I added this, contextual links regained the functionality. Still not sure where it comes from though, or if it's the only thing sufficient in all cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.