Drupal theming

Blog

Make oembed fill its frame with their video content in Drupal

I recently had issue styling oEmbed Youtube and Vimeo videos. Thanks to this snippet, they fill in the oEmbed frame instead of having to deal with annoying height issues:

Blog

Access the parent paragraph inside child paragraph with Twig in Drupal

Sometimes you need to know inside which parent paragraph the current paragraph you are working in is. Here is how to do it in Twig.

Blog

Installing a Drupal theme from GitHub with Composer

In this blog post, we'll guide you through the process of installing a Drupal theme from a GitHub repository using Composer.

Blog

How to Fetch and Display the Label of a List Field in a Twig Template (Drupal 10)

In this post, we will explore some of the most effective methods to help you display the label of a list field in your Twig template.

Blog

How to Use the Ternary Operator in Twig in Drupal 10

In Drupal 10, you can use the ternary operator in the same way as in regular Twig code. Here's an example of how you can use the ternary operator to create an array of CSS class names based on some conditions:

Blog

Drupal Behaviors: A How-To Guide to Javascript

Writing JavaScript code in Drupal can be challenging because of the way Drupal handles JavaScript. Drupal has a concept called "Drupal behaviors" that can help you write better JavaScript code that works consistently across your site.

Blog

Get url path of referenced node image in Twig and Drupal 10

This snippet will definitely save you some time searching for the proper structure, it loops over entity referenced nodes and sets a background image from that node

Blog

Get url path of an entity reference in Twig in Drupal 10

This post gives you a snippet to get the URL path of an entity reference in Twig

Blog

Get page title inside of a paragraph in Drupal 10

I encountered this when I had to build a hero paragraph. I needed the page title inside my paragraph.

Subscribe to Drupal theming