nerdfisch: DevBits

Kleine, aber feine Code-Snippets, nützliche Tweaks und elegante Lösungsansätze aus dem Entwickler-Alltag

09.07.2026 | Michael Ebert

Install comment_notify module to have an easy solution to subscribe/unsubscribe to nodes like a forum topic.

Installation with composer:

composer_require.sh
composer require 'drupal/comment_notify'

Enable with drush:

drush_pm_install.sh
drush pm:install comment_notify

Configure it under ../admin/config/people/comment_notify.
Select the Bundle on that you want to enable it. Chose "All Comments" under availible subscription modes and set it as default state. 
 

Comment Notify Configuration
sh
composer
notification
09.07.2026 | Holger Weischenberg

Hide HTML comments in Chrome and Firefox browser inspector

Image showing various settings options in a developer tools interface.

 

 

html
browser
debugging
frontend
22.06.2026 | Pascal Crott

Gin: Make use of the simple table

my_module.module
<?php

/**
 * Implements hook_theme_suggestions_HOOK_alter() for table.
 */
function hook_theme_suggestions_table_alter(array &$suggestions, array $variables): void {
  if (empty($variables['attributes']['class'])) {
    return;
  }

  if (is_array($variables['attributes']['class']) && in_array('ief-entity-table', $variables['attributes']['class'])) {
    $suggestions[] = 'table__simple';
  }
}
module
Gin backend theme
copy-paste
templates
22.06.2026 | Mathias Grab

How to enable Twig debug in Drupal

development.services.yml
parameters:
  twig.config:
    debug: true
    auto_reload: null
    cache: false
yml / yaml
twig
debug
11.06.2026 | Michael Ebert

Change the order of local tasks

my_module.module
function my_module_local_tasks_alter(&$local_tasks) {
  if (isset($local_tasks['entity.section_library_template.collection'])) {
    $local_tasks['entity.section_library_template.collection']['weight'] = 110;
  }
    
  if (isset($local_tasks['feeds.admin'])) {
    $local_tasks['feeds.admin']['weight'] = 120;
  }

}

php
routing
local task links
weights