Add a Contextual Link for Drupal 8, Drupal 9

Last updated March 8, 2021
Module Development8.9.x/9.0.x

Contextual links provide yet another method for Drupal module developers to add helpful links for site administrators to quickly navigate to commonly used tasks. In this tutorial we'll learn how to implement and render contextual links from a custom module. We will also look at a pair of alter hooks that can be used to tweak existing contextual links.