Drupal

Blog

How to make core version drupal 9 compatibe in module .info file

Make sure to edit the .info file to make your module compatible with drupal 8 & 9.

Blog

Delete users that never logged in in drupal 8

An important clean-up task on bigger websites is to remove unused accounts. This snippet does the work.

Blog

Get drupal version with drush

Simple command to get the current drupal version

Blog

Get route of a views page with drupal console

I like drupal console a lot as a helper tool for development. In this snippet I wanted to get the route of a views page. The page is on /news-events.

Blog

Set frontpage programmatically in drupal 8 & 9

Snippet to programmatically set the frontpage

Blog

Give only custom block access but not block overview in drupal 8

Personally I do not like giving block access to website editors. In this one case, there was a need to edit custom blocks. I granted access to administer blocks, but I blocked access to the overview page with this EventSubscriber.

Blog

Get current user role in drupal 8 or 9

Getting the current user role in code is quite easy, here's the snippet.

Blog

Query nodes in drupal 8 & 9

A simple query example for drupal 8 and 9.

Blog

Apply patch in composer without updating other modules

Patching workflow in drupal is something you need to learn a bit. I stumbled on a few cases where I would have to update one module only and want to prevent from updating the entire system. Here's the snippet

Blog

Log messages in drupal 8 & 9

Loggin is very important. These snippets need to be used, be as precise as possible.

Subscribe to Drupal