Articles
Theming
Rendering plugin blocks the right way
On a recent client website, I needed to programmatically load and render 3 blocks. Plugin blocks to be precise. In modern Drupal, there are 3 types of block you can load/render:Read article →Fixing Sass @import deprecation warnings
Using Sass >= 1.80 and wanting to shush those @import deprecation notices with minimal effort? Or ready to upgrade towards 3.0.0 ?Read article →Upgrading jQuery 1.x to version 3.x
I was recently tasked with upgrading jQuery from 1.9 all the way up the latest version of 3.x (3.4). And I seriously thought “There is no way jQuery is on version 3 already!”. How wrong I was. Thankfully I wasn’t the only one thinking this, a few of my colleagues were on my…Read article →Custom AJAX loading icon
There's nothing like Drupal's stock AJAX spinner (this: ) to make you notice that a site's design hasn't been fully customised. The code from my previous article showing how to fetch a link over AJAX to open in a Foundation reveal popup would suffer from this without some…Read article →Localising dates in twig templates
A client noticed the dates on their news articles were not being translated into the correct language. The name of the month would always appear in English, even though all the month names had themselves been translated and showed correctly elsewhere. The problem turned out to…Read article →Where is my content coming from?
I was asked at Drupalcamp London how to identify where parts of a panel come from. Whether you need to change something on a site you inherited, are looking to trace your steps back on something you created long ago, or need to understand how to fix a colleague's mistake, it…Read article →Place blocks inside your content with EBA
Previously on this website I have written about rendering blocks programmatically and adding things to content to be managed alongside fields. It's time to combine the two! On many projects, we find ourselves needing to render a block consistently across all content of a…Read article →Render a block programmatically
This is a real quick one, but so useful! We often want to render a block within content, perhaps as part of a node (maybe in hook_node_view, and then made configurable like a field), but there's no obvious way to do this correctly for any block. Drupal normally renders its…Read article →Setting default drupal theme during installation : programatically install a drupal theme
Here's a quick post that will be a reminder for us as much as anyone else! Setting the default theme during installation using an installation profile is surprisingly hard in Drupal 6, and easier though not obvious in Drupal 7. In Drupal 6, we used the wonderful Install Profile…Read article →Drupal TinyMCE buttons displaying on multiple lines
A quick post about the Drupal tinymce module and it's tendancy to display all it's buttons in one inflexible line. The following CSS will split the tinymce buttons onto several lines.Read article →Drupal - changing the calander view to display single letter for day of the week
By default the Drupal event module will provide a nice calander block, listing the days of the week accross the top using 3 letter abbreviations (mon, tue etc).Read article →Let's talk
Got a project in mind?
You'll talk to a developer, not a salesperson.