How to make a Drupal 8 local task title dynamic

When defining local tasks (= tabs) in your Drupal 8 modules, you can specify a title for the tab via the 'title' property in your [MODULENAME].links.task.yml file.

However, in some cases you might want to make the task title dynamic, e.g. depending on the context of the entity where the tab is displayed.
This can be achieved by overriding the \Drupal\Core\Menu\LocalTaskDefault class with your own class for that tab.

Here is an example that uses a callback function to dynamically set the title, both for the route and the local task:

 

Using Drupal 8 contact forms via REST

While working on Narwhal CMS, our hosted decoupled / headless CMS service built on Drupal 8, a feature request that has popped up multiple times is the ability to have (contact) forms in the frontend application or website be processed by the Drupal backend through REST. Drupal 8 provides you with REST services and fieldable contact forms out of the box, but doesn't provide all the pieces to get this specific use case working. In the tutorial below I will show you how to implement this on your Drupal 8 website.

Book review: Drupal 7 Development by example

In the book 'Drupal 7 Development by Example', author Kurt Madel guides the reader through the process of building a Drupal 7 website. Step by step we are building an HTML5 interactive recipe website. The book covers setting up content types, using Views to list recipes and create blocks, integrating the Media module, HTML5 theming and enhancing the website markup with Microdata. Furthermore widely used modules such as Webform, Fivestar, Views Slideshow and Features are covered.