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:
- Navigate to the modules administration page (Administer > Modules).
- In the Core section of the Modules page, enable the Contextual Links module
- Click Save Configuration.
Configuring contextual links permissions
To set permissions for different user roles to access the contextual links:
- Navigate to the Permissions page (People > Permissions tab).
- For each role you can enable or disable the Use contextual links permission.
- 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
$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.