Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in
By admin, 14 October, 2025

How Drupal 11.3 Makes Working with HTMX Easier: A Deep Dive into HtmxRequestInfoTrait

Drupal 11.3 introduced a small but powerful enhancement for developers working with HTMX — a new trait called HtmxRequestInfoTrait. This addition dramatically simplifies how we detect and process HTMX requests inside controllers, forms, and services.

In this article, we’ll cover:

Tags

  • #Drupal Planet
  • HTMX
By admin, 9 October, 2025

Drupal 11.3: Views Plugins Now Require Explicit Initial Preprocess Callbacks

Published in Drupal 11.3.x

Drupal 11.3 introduces a significant change in how preprocess functions for Views plugins are handled.
Previously, Drupal would implicitly discover functions like template_preprocess_HOOK() and apply them automatically to corresponding templates. This implicit behavior is now deprecated.

Tags

  • #Drupal Planet
By admin, 7 October, 2025

Deprecation Alert: theme_file in Views Plugins Is Going Away in Drupal 12

Introduced in Drupal 11.3.0

Drupal core continues its modernization journey, and one of the latest updates affects how Views plugins define their template preprocess functions.
If your Views plugin currently uses the theme_file key in its plugin definition — it’s time to update your code.


🔍 What Has Changed

In previous Drupal versions, Views plugins could include a key like this in their plugin annotation:

Tags

  • #Drupal Planet
By admin, 6 October, 2025

Understanding Render Arrays and Theme Hooks in Drupal

Drupal is a powerful content management system that separates data from presentation. Two key concepts that make this possible are render arrays and theme hooks. Understanding these is essential for writing clean, maintainable Drupal code.


1. What is a Render Array?

A render array is a structured PHP array that tells Drupal how to render a piece of content. It is processed recursively by the Renderer service (RendererInterface).

Tags

  • #Drupal Planet
  • Render Array
  • Theme hook
By admin, 4 October, 2025
This kind of visual immediately shows readers the architectural difference and why Drupal is more robust for complex projects.

5 Reasons Why WordPress Doesn’t Separate Business Logic and Presentation (With Examples)

Modern web applications are built on the principle of separating business logic (data processing, site rules) from presentation logic (how content is displayed to the user). Drupal strictly follows this principle, while WordPress often mixes these layers. Here are five reasons with concrete examples.


1. Functionality Tied to the Theme

WordPress:

Tags

  • #Drupal Planet
  • WordPress
By admin, 3 October, 2025

Creating a Custom Token Decorator in Drupal: Extend and Control Token Replacement

🔹 How to Create a Custom Decorator for Token in Drupal

In Drupal, tokens allow dynamic values to be substituted into text, email templates, fields, and more. There are two main Token classes:

Tags

  • #Drupal Planet
  • Token
By admin, 3 October, 2025

Theme Hook Definitions for Views Plugins in Drupal 11: Moving Preprocess Logic to ThemeHooks Classes

In Drupal 11.3.0, a change landed that modernizes how Views plugins handle their preprocess callbacks. If you are maintaining custom Views plugins or themes, this is important to know.


Background: How It Worked Before

Traditionally, Drupal discovered preprocess functions implicitly.
For example, if you had a Views display plugin with a theme hook called views_display_example, Drupal would look for this function automatically:

Tags

  • #Drupal Planet
  • ThemeHooks classes
By admin, 2 October, 2025

Drupal 11.3.x Change: Block Content Module No Longer Ships with the Body Field

In Drupal 11.3.x, the block_content module has dropped the automatic creation of the default Body field (field.storage.block_content.body.yml). This is part of an ongoing effort to reduce assumptions in core and give site builders more control over content architecture.

Tags

  • #Drupal Planet
  • Drupal Body field
By admin, 1 October, 2025

Drupal 11.3 Removes Path Alias Preload Cache – What Developers Need to Know

With the release of Drupal 11.3, a long-standing optimization has been removed from core: the path alias preload cache. This mechanism, introduced in Drupal 6, has officially been deprecated and replaced with a more modern approach.

In this article, we'll explore why the preload cache was removed, what replaced it, and what—if anything—you need to change in your custom or contrib modules.

Tags

  • #Drupal Planet
  • Path Alias Preload Cache
By admin, 29 September, 2025

Boosting Page Performance in Drupal 11.3 with Page Cache Middleware and Service Closures

Drupal 11.3 brings several performance improvements, and one of the most impactful changes is in the Page Cache Middleware. In this article, we’ll explore what has changed, why it matters, and how to update your custom modules and middleware for optimal caching.


What’s Changed?

Previously, whenever a request was processed in Drupal, all middleware and services were constructed, even if the page was already cached. This unnecessary overhead slowed down cached page delivery.

Tags

  • #Drupal Planet
  • Page Cache Middleware

Pagination

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