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.

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.

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.

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:

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.

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

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

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.

How to access custom block content field in Twig (Drupal 10)

I started using custom blocks for reusable content on a website. It turns out twig works a bit different on block content than on paragraphs.

How to loop over field items in twig file in Drupal

If you want to use a looping functionality in x.html.twig​​​​​​​ you can use the following:

Subscribe to Drupal theming