Blog

Cache block per user in drupal 8

I'll share with you some code on how to cache blocks per user. The secret lies in using the right cache context on the build() function of your block.

Blog

Drupal 8 swiftmailer html template example

Here's a html e-mail template example for sending html e-mails.

Blog

Fix the "Entities exist of type x and need to be deleted before importing" drupal 8 error

Configuration management is great. But you'll encounter some difficulties at first when importing existing config to a new site. A typical error is the "Entities exist of type" error. Here's how to fix them.

Blog

Get single field value in drupal 8

getting entity field values programmatically is easy, but check this out.

Blog

Send email notifications to webmaster on certain events in drupal 8

Today I have a small helper module to share with you. A small pain in the ass is that the sending of e-mails requires a bit too much code. More specifically sometimes you would like to send simple alerts to webmasters. This helper module helps you with it.

Blog

How to send html emails with drupal 8 [SOLVED]

One of the biggest flaws in drupal is the disability to do something easy as sending html emails out-of-the-box. In drupal 8 it is already slightly better, but you would need to know some things.

Blog

How to get config entity value in drupal 8

Config entities are new in drupal 8. The differ a bit from content entities. Here a snippet on how to get the value of a field programmatically.

Blog

Drupal 8 messenger api: how to set message examples

Drupal set message was deprecated in Drupal 8.5 and will be removed before Drupal 9. Time for a roundup of this new API and how to use it.

Blog

Get list of active languages in drupal 8

Short snippet to get the enabled languages programmatically

Blog

Add a block class programmically in drupal 8

Small snippet to show how to add a class to your block

Subscribe to