-
Drupal 11: Node Display Mode Preview Form
This is part five of a series of articles looking at HTMX in Drupal.
In this article we will look at creating a simple form that allows users to enter a node ID and a view mode and see the node rendered in that view mode. The article is a detailed look at how the HTMX is used to generate this effect in Drupal.
https://www.hashbangcode.com/article/drupal-11-node-display-mode-preview-form
#drupal #drupal11 #drupalHtmx -
New! Drupal 11: Cascading Select Forms With HTMX
This is part four of a series of articles looking at HTMX in Drupal.
In this article we will look at creating a form that contains multiple select elements and then use HTMX (and a little bit of the form states API) to tie them together so that selecting one element updates the others.
https://www.hashbangcode.com/article/drupal-11-cascading-select-forms-htmx
-
From the archive! Drupal 10: Testing Migration Process Plugins
Creating migration process plugins is quite easy in Drupal. What isn't easy is fixing things in content after the migration has run.
This article goes over creating a migration process plugin, and then writing unit tests for it. Essential if you want to ensure that they change content correctly before running the migration.
https://www.hashbangcode.com/article/drupal-10-testing-migration-process-plugins
#drupal #drupalDevelopment #drupalMigration #hashbangcode -
New! Drupal 11: Creating A Tabbed Interface With HTMX
This is part three of a series of articles looking at HTMX in Drupal.
In this article we will be creating a tabbed interface in Drupal, where HTMX is used to power loading the data in a tab like section without reloading the page.
https://www.hashbangcode.com/article/drupal-11-creating-tabbed-interface-htmx
#drupal #drupalDevelopment #drupal11 #htmx #hashbangcode -
From the archive! A Look At HTMX With PHP
We have more Drupal and HTMX articles coming next week. In the meantime, here's a look at HTMX and PHP.
-
New! Drupal 11: Building A "Load More" Feature For Paginating Nodes Using HTMX
In this article a controller action is created to load some pages of content to display them as a list.
New items can be appended to the existing list using a HTMX callback, creating a load more feature.
https://www.hashbangcode.com/article/drupal-11-building-load-more-feature-paginating-nodes-using-htmx
#drupal #drupal11 #drupalDevelopment #drupalHtmx #hashbangcode -
From the archive! Drupal 9: Extending Drupal Base Classes Without Overriding Constructors
This article details a technique for injecting dependencies into constructors, forms, and plugins without needing to override the constructor.
We break down how to use dependency injection and what the technique does to improve this in Drupal.
Despite the article being written for Drupal 9, the technique is still relevant in Drupal 11.
https://www.hashbangcode.com/article/drupal-9-extending-drupal-base-classes-without-overriding-constructors
#drupal #drupalDevelopment #hashbangcode -
New! Drupal 11: Making Interactive Elements With HTMX
HTMX is a JavaScript library that allows you to make ajax calls and create CSS transitions without writing any JavaScript code.
In this article we will look at how HTMX is integrated into Drupal, and what services exist to help you use it within the Drupal system.
https://www.hashbangcode.com/article/drupal-11-making-interactive-elements-htmx
#drupal #htmx #drupalDevelopment #hashbangcode -
New! Drupal 11: Finding A Better Way To Display Code Examples
In this article I will look at a few code sandboxes and how they might be integrated into Drupal.
I'll then look at one code sandbox in particular and allow this to be embedded into article content.
https://www.hashbangcode.com/article/drupal-11-finding-better-way-display-code-examples
#drupal #drupal11 #javascript #hashbangcode -
New! Drupal 11: Theming The Search API Search Input
In this article we will look at how we can use a combination of form alters and suggestion hooks to change the Search API form submit input to a button. This is so that an SVG magnifying glass icon can be embedded inside.
https://www.hashbangcode.com/article/drupal-11-theming-search-api-search-input
#drupal #drupal11 #drupalDevelopment #hashbangcode -
Our latest article on controling LED lights through Drupal by @philipnorton42 was featured by Dries Buytaert (the founder of Drupal)
https://dri.es/christmas-lights-powered-by-drupal
Dries gives us some interesting ideas on extending this project, so we'll have to do something more with this next year.
#drupal #drupalDevelopment #hashbangcode -
New! Drupal 11: Controlling LED Lights Using A REST Service
It is quite easy to create RESTful services in Drupal; it just needs a single class. All I would need to do is create a form to control the colour that is selected in the REST service.
In this article we will look at creating a Drupal module containing a RESTful interface, which we will connect to with the Plasma 2350 W to update the colour of the lights.
https://www.hashbangcode.com/article/drupal-11-controlling-led-lights-using-rest-service
#drupal #drupal11 #microPython #hashbangcode -
New! Drupal 11: How To Alter Entity View Builder Configuration Before Rendering
In this article we will look at using the view builder to generate a renderable view of an entity and then look at how to alter the attributes of the view mode without using a preprocess hook.
https://www.hashbangcode.com/article/drupal-11-how-alter-entity-view-builder-configuration-rendering
#drupal #drupal11 #drupalDevelopment #hashbangcode -
From the archive! A Look At Flood Fill Algorithms In PHP
If you have ever used a paint program then you might have used a flood fill algorithm. This is a mechanism by which an area of an image can be filled with a different colour.
In this article we will look at two flood fill algorithms, in PHP, and then extend them to look at using a threshold to control how much of the image is filled in.
https://www.hashbangcode.com/article/look-flood-fill-algorithms-php
-
From the archive! Drupal 10: Creating A Notification System Using The Message And ECA Modules
In this article we will look at how to create a notifications system that will tell users about important events that they might be interested in.
This uses the Message, ECA, and Token modules (and some glue code) to create an event message system.
https://www.hashbangcode.com/article/drupal-10-creating-notification-system-using-message-and-eca-modules
#drupal #drupalDevelopment #eca #hashbangcode -
New! Drupal 11: Programmatically Change A Layout Paragraphs Layout
The Layout Paragraphs module is a great way of combining the flexibility of the layout system with the content component sytem of the Paragraphs module.
In this article we will look at the structure of the Layout Paragraphs module and when how to move a Layout Paragraph from one layout to another using PHP.
https://www.hashbangcode.com/article/drupal-11-programmatically-change-layout-paragraphs-layout
#drupal #drupalDevelopment #paragrpahs #hashbangcode -
New! Drupal 11: Using SDC Component Library To Preview Single Directory Components
You can use the SDC Component Library module to preview them whilst you are building them, and then integrate them into your site once they are ready.
In this article we will look at setting up a theme with an SDC, and then using the SDC Component Library module preview that component.
#drupal #drupalDevelopment #singleDirectoryComponents #sdc #hashbangcode
-
From the archive! Drupal 9: Content Sharing Between Drupal Sites Using oEmbed
In this article we cover what oEmbed is and how to set up a custom oEmbed endpoint. We then set up and configure a Drupal site to consume that custom oEmbed endpoint.
A technique that still works in the same way in Drupal 11!
https://www.hashbangcode.com/article/drupal-9-content-sharing-between-drupal-sites-using-oembed
-
From the archive! Drupal 10: Creating A Homepage With The Config Pages Module
This article helped someone build a homepage using the Config Pages module last week. We know this because they got in touch with some clarifications, and we were able to assist.
Read more here: https://www.hashbangcode.com/article/drupal-10-creating-homepage-config-pages-module
#drupal #drupalDevelopment #hashbangcode -
New! Drupal 11: Object Oriented Hooks And Hook Service Classes
New in Drupal 11.1.0 is the ability to create object oriented (OOP) hooks, which is a shift away from the traditional procedural based hooks that have been a part of Drupal for so long.
In this article we will look at how to create a OOP hook, how to transition to using OOP hooks in your Drupal modules, and how to create your own OOP hooks.
https://www.hashbangcode.com/article/drupal-11-object-oriented-hooks-and-hook-service-classes
-
From the archive! Drupal 9: Creating A Category Menu Using Derivers
How to set up a menu deriver and then using that deriver to inject custom elements into the menu.
Derivers can be used with menus, local tasks, action links, contextual links, migrations, help topics, and a number of plugin types.
Tip: Add the words "deriver" and "derivers" to your spell checker ;)
https://www.hashbangcode.com/article/drupal-9-creating-category-menu-using-derivers
-
New! LocalGov Drupal Camp 2025
LocalGov Drupal Camp 2025 was held in The Abbey Community Centre (near Westminster Abbey in London) on July 3rd 2025.
I travelled down (despite the English rail network's attempts to the contrary) for the day as an attendee.
https://www.hashbangcode.com/article/localgov-drupal-camp-2025
#drupal #localgovDrupal #localgovDrupalCamp #localgovDrupalCamp2025 #hashbangcode
-
From the archive! Drupal 9: Entity Bundle Classes
Drupal 9.3.0 came with a new feature called entity bundle classes. This allows more control of entity bundles within Drupal and provides a number of benefits.
In this article we look at creating entity bundle classes, why they are useful, if you should be using them in your Drupal projects.
https://www.hashbangcode.com/article/drupal-9-entity-bundle-classes
#drupal #drupal10 #drupal11 #drupalDevelopment #hashbangcode -
From the archive! Creating A Game With PHP Part 4: Side Scrolling Shooter
This article looks at creating an ASCII based game played on the command line, in PHP.
A side scrolling shooter, if you didn't already know, moves a scene from right to left across the screen with enemies moving with the scene towards the player's ship, which is on the left hand side of the scene.
https://www.hashbangcode.com/article/creating-game-php-part-4-side-scrolling-shooter
-
From the archive: Drupal 10: Adding Custom Permissions To Groups
The Group module in Drupal is a powerful way of collecting together users and content under a single entity.
This article looks at all of the ways in which you can add permissions to Groups. Plus, the content has been verified as correct by the Group module author :)
https://www.hashbangcode.com/article/drupal-10-adding-custom-permissions-groups
#drupal #drupalDevelopment #hashbangcode -
New! LocalGov Drupal Camp 2024 https://www.hashbangcode.com/article/localgov-drupal-camp-2024
#localgovDrupal #drupal #hashbangcode -
New! Generating Histogram Colour Analysis Graphs From Images In PHP
https://www.hashbangcode.com/article/generating-histogram-colour-analysis-graphs-images-php
#php #histogram #colours #hashbangcode