Last updated July 2, 2015. Created on December 10, 2009.
Edited by dougBelcher, brahmjeet789, ezheidtmann, dman. Log in to edit this page.

In Drupal 7, some modules supply contextual links that allow privileged users to quickly perform tasks that are related to regions of the page without navigating to the Admin Dashboard. For example, when you hover your mouse over a block or node, links are displayed that allow you to make changes to the block or node.


You can enable and disable contextual links and you can specify the user roles that have permission to view and use contextual links.

Enabling contextual links

To enable the Contextual links module:

  1. Navigate to the modules administration page (Administer > Modules).
  2. In the Core section of the Modules page, enable the Contextual Links module
  3. Click Save Configuration.

Configuring contextual links permissions

To set permissions for different user roles to access the contextual links:

  1. Navigate to the Permissions page (People > Permissions tab).
  2. For each role you can enable or disable the Use contextual links permission.
  3. Click Save Permissions.

Note that contextual links are not displayed if the user does not have permission to perform the specific action represented by the link.

Displaying contextual links

When using default rendering, the normal teaser view will embed the contextual links on nodes for you.

If using a customized theme, your node template should include the normal renderable elements found in core's node.tpl.php. Specifically, the contextual links are provided by the line
print render($title_suffix);
$title_suffix is where these functions are usually inserted. The same should apply to blocks and other places contextual links are available.

In order for the contextual links to be positioned correctly, you must ensure the "contextual-links-region" class is present on a containing element. The theme system will usually provide this class in the $classes variable in your node template, but if you are overriding classes or specifying them directly in the template, you will have to add this class explicitly.

Contextual links are not available by default to views with "field" based rows.

Looking for support? Visit the forums, or join #drupal-support in IRC.


waqariz’s picture

That's really cool and informative :)

slawrence10’s picture

Thanks this "fixed" my issues with contextual links on teasers.


  1. Include <?php print render($title_suffix); ?> after title for teaser template
  2. Use css class contextual-links-region in containing div