Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in
By admin, 28 June, 2025

Drupal 11.2 Hook Migration Guide: Modernize Your Module’s Hooks with Attributes

🔄 Updating hook_help() When Migrating from Drupal 8 to Drupal 11.2

With the release of Drupal 11.2, developers are encouraged to modernize their codebase by replacing legacy hooks with more structured, object-oriented alternatives. One of the most commonly used hooks in legacy modules is hook_help() — the function that adds helpful module documentation to the /admin/help page.

Tags

  • #Drupal Planet
  • Hooks
By admin, 26 June, 2025

Drupal Theming and Layout: When to Use Paragraphs, Layout Builder, or Twig Templates

In Drupal, Paragraphs, Layout Builder, and custom templates are all tools for controlling how content is structured and displayed — but they serve different purposes and are used in different contexts. Here's a clear breakdown of each and when to use them:


✅ 1. Paragraphs

❓ What it is:

The Paragraphs module lets site builders define reusable, flexible content components (like “Image + Text”, “Slider”, “Video”, etc.) that editors can mix and match in a structured way within content types.

Tags

  • #Drupal Planet
By admin, 26 June, 2025

Why More Indexes in MySQL Aren't Always Better

🛑 When Indexing Can Hurt MySQL Performance

Indexes usually improve query performance, but in some cases, they can actually make things worse. Here are the key situations:

Tags

  • #Drupal Planet
  • MySQL
By admin, 26 June, 2025

How to Efficiently Load and Process 10,000 Nodes in Drupal Without Killing Performance

If you need to retrieve data from 10,000 nodes in Drupal, the most efficient way is to load them in batches, not one-by-one in a loop and not all at once.

Tags

  • #Drupal Planet
By admin, 23 June, 2025

Mastering OOP and SOLID Principles in PHP with Drupal Examples: A Complete Guide

Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data (fields, often called attributes or properties) and code (methods, which are functions associated with the object).

There are 4 main principles of OOP, often remembered by the acronym "PIES":

🔠 What is PIES?

PIES stands for the four core OOP principles:

Tags

  • #Drupal Planet
  • OOP
  • SOLID
By admin, 26 May, 2025

Combining Tailwind CSS and Bootstrap (Radix) in a Drupal Theme: A Step-by-Step Guide

Introduction

Modern frontend requirements in Drupal projects demand more flexibility, customization, and fast adaptation to design specifications. Tailwind CSS is a utility-first CSS framework that enables developers to build unique UI solutions quickly and precisely without writing extra CSS. However, many Drupal projects still use the Radix theme, which is based on Bootstrap—a reliable framework with a rich set of ready-made components.

In this article, we'll cover:

Tags

  • #Drupal Planet
  • Tailwind
  • Bootstrap
  • Radix
By admin, 10 April, 2025

Laravel for Drupal Developers: Comparing Eloquent and Entity API

Direct comparison between Laravel (Eloquent) and Drupal (Entity API) — especially useful if you're coming from a Drupal background and exploring Laravel.

🔁 Laravel Eloquent vs Drupal Entity API

✅ Fetching filtered content

Laravel:

$tasks = Task::where('completed', true)->get();

Drupal:

Tags

  • #Drupal Planet
  • Laravel
  • Eloquent
By admin, 22 February, 2025

Why Using current_route_match in Access Checks is Problematic

If you inject the current route match service (current_route_match) and use it inside an access() method, your access check will only work when the user is actually visiting that route in the browser.

However, if access is checked programmatically from another page (e.g., via an access API or a block), the current route match will be from that other page, not the one you actually want to check access for.

Tags

  • #Drupal Planet
  • Access Check
By admin, 26 January, 2025

To create a custom ddev command for running php bin/magento in a Magento project

To create a custom ddev command for running php bin/magento in a Magento project, follow these steps:


1. Open the .ddev/commands/web or .ddev/commands/host directory

This is where custom commands for ddev are stored.


2. Create a new file for the command

Create a file named .ddev/commands/web/magento (no file extension) and add the following content:

Tags

  • DDEV
  • Magento
By admin, 4 December, 2024

How can AI help in understanding regular expressions using Drupal examples?

Researching regular expressions with the help of AI using examples from Drupal functions allows us to understand how to efficiently analyze and process text data in Drupal, including searching, replacing, filtering, and other operations. Regular expressions (regex) are a powerful tool for working with text, and their use in Drupal plays a key role in various functions such as input processing, data validation, content parsing, and much more.

Let's look at examples of regular expressions used in Drupal and how AI can assist in their analysis and optimization.

Tags

  • #Drupal Planet
  • Regular expressions

Pagination

  • First page
  • Previous page
  • …
  • Page 3
  • Page 4
  • Page 5
  • Page 6
  • Page 7
  • Page 8
  • Page 9
  • Page 10
  • Page 11
  • …
  • Next page
  • Last page
Powered by Drupal