Skip to main content
Found the solution
Follow me here
Nid to url in twig [Drupal 8]
What if you have to link to a specific url in in twig, but you only have the nid? Moreover, it is good practice to use the id and not a hardcored url. Here's what you should use:
about Nid to url in twig [Drupal 8]
drupal 8: image field to image style programmatically
Helper snippet to render images with an image style in drupal 8
about drupal 8: image field to image style programmatically
Create string translations programmatically in drupal 8
String translations are always a bit a pain in the ass for drupal. Luckily, in drupal 8 the function is rather easy.
about Create string translations programmatically in drupal 8
Delete all users of a role in drupal 8
Snippet on how to remove all users with a certain role in drupal.
about Delete all users of a role in drupal 8
Delete all menu links of a menu programmatically in drupal 8
I play a lot with importing and exporting content lately. When I remove content, the created menu items need to be removed automatically. Here's a snippet on how to delete all links in a menu.
about Delete all menu links of a menu programmatically in drupal 8