Blog

Three ways to convert a string to number in TypeScript

Exactly like in JavaScript, you can use the parseInt or parseFloat functions, or simply use the unary + operator:

Blog

My thoughts on Github Copilot for Drupal development (screencast)

like many I tested out GitHub co-pilot and I specifically tested it out for drupal development now would this be useful as a drupal developer will this boost my productivity, in short, yes I would definitely say so

Blog

Set auto focus to ionic input in Ionic 6 and Angular 13

I stumbled upon setting focus to an element in Ionic. As it appeared, there is no directive to use (anymore) to autofocus an ionic input.

Blog

Accessing and setting values of field properties of entities in Drupal

Here are some ways to access field properties on entities in Drupal

Blog

EntityQuery access check will be enforced in Drupal 10

Until Drupal 9.2, if ::accessCheck() is not called then the query would default to checking access, i.e. behave as if ::accessCheck(TRUE) had been called.

Blog

How to add HTML to Drupal Messenger API service

Drupal now has a messenger service, powered by the class Drupal\Core\Messenger\Messenger. Here is how you can add HTML to the message

Blog

How to: cacheable JSON response in Drupal 8, 9 & 10

In my book Learning Drupal as a framework, we learn some nice things about cacheable dependencies. Recently I had to provide a JSON controller with cached data.

Blog

How to add direct share links to your Drupal page in page.html.twig

The following snippets can be used to get direct share links to Facebook, Twitter and LinkedIn in your page.html.twig

Blog

Get a link field url and value in Twig for both internal and external links

Drupal's link field is quite generic. You can both add internal paths as external links. Here is how get the correct values in twig.

Blog

How to check if local storage item exists in TypeScript

This is a rather easy one. I was adding my filtering values in my local storage and had to check if a "library" key existed.

Subscribe to