Blog
Increase the length of a custom entity name field in drupal 8 [SOLVED]
It is a bit strange that the name field (which functions like the node's title field) can be only 50 characters long. The snippet I'd like to share with you, makes it 255 long.
Blog
Styling the 404 error pages in drupal 8
Drupal ships with an ugly 404 page by default. in this tutorial I learn you how to add markup to it.
Blog
Get entity reference objects from node programmatically in drupal 8
There is a great shortcut I use a lot when dealing with entity references (the're great, right). I thought I'd share the snippet here.
Blog
How to check if custom entity is published in drupal 8 [SOLVED]
We all well know the functions to check if a node is published or not, but what about a custom entity?
Blog
How to render a table in drupal 8 (with html in cells)
You create a custom controller and want to show a table that resembles the core back-end tables. This snippet shows you how to do it.
Blog
Two ways of getting the current node id in drupal 8
A very recurring thing you would do is to get the current node id of the visited page. Here are two ways of doing it programmatically.
Blog
Drupal 8: get the current path alias
Where in drupal 7 you would typically use something like drupal_get_path_alias(), this is different in drupal 8.
Blog
How to access a field value from entity (or node) object in drupal 8, 9 & 10
Discover how to access field values from entity or node objects in Drupal 8 and 9, covering regular text, link, entity reference, image, date, boolean, and list fields.
Blog
Get parameter from url in drupal 8 [solved]
Short snippet that shows how to get url parameters in drupal 8. Where in drupal 7 you would have to do some $_GET or work with args(0), you now have a clean function to do this.
Blog
How to use image styles in Twig on drupal 8
I had to loop over some images in Twig and dynamically adding image styles to them. Without using contrib this seemed a bit hard to do. I found a fix and I share it here with you.