Drupal

Blog

Create or add a menu item without a link in drupal 8

In drupal 7 we had some contrib modules using a <nolink> tag to make subtitles in our menu. In drupal 8 I try to avoid contrib modules on my menu items. Here's a hint on how to get it to work.</nolink>

Blog

Set placeholder for Chosen widget in drupal 8 form alter

The chosen widget is my default option for select widget. This snippet shows you how to add the placeholder in a form alter.

Blog

Create an instagram widget of an hashtag in drupal 8

For a few months I'm working in my spare time on a module that can import instagram feeds and turn it into nodes. And on top of that, a nice javascript extension to make it look beautiful out-of-the box.

Blog

Make sure javascript keeps working after ajax call in drupal 8 [solved]

A thing developers can forget while testing, is to make sure all functionality of your module is stable when used in the context of ajax. Some plugins might stop working after an ajax call on the page. This is how to prevent such thing.

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.

Subscribe to Drupal