Drupal Development
Presentation: At 16 years of age - does Drupal have an identity problem?
At Drupal South 2016, I attempted to summarize some of my pain points with Drupal core.
The session 'At 16 years of age, does Drupal have an identity problem' is the result of this.
You can watch the recording, or download the slides below.
Launching an AJAX modal from a WYSWIYG link and customising the response with MainContentRendererInterface in Drupal 8
On a recent project a feature was requested to allow admins to launch some content within a modal window from the WYSWIYG on a Drupal 8 website. The goals were as follows:
- Open any content on the site in a modal window.
- Fall back to a plain link for search engines and non-js based browsers.
- Implement a branded modal design.
This is how we accomplished it.
We could add default content to Drupal core, but what would that mean?
There has been some movement of late around adding some default content to the standard profile.
This was originally reignited by Roy Scholten in his getting something in the box post.
As author and co-maintainer of the default content module for Drupal 8, I wanted to share my thoughts on the potential of adding it to Drupal core.
Custom views filters with Search API and Simple Hierarchical Select
A recent project involved the use of the Simple Hierarchical Select module to input category data for a particular content type. Simple Hierarchical Select provides a clean way of browsing hierarchical vocabularies to easily add taxonomy terms to nodes.
An initially tricky user interface problem to utilise this module with Search API and Views exposed filters was solved using a couple of Drupal 8 plugins and a bit of smart thinking!
Introducing Drush CMI tools
Now we've got the experience of a number of production D8 sites under our belt we took the time to consolidate our CMI workflow into some useful drush commands.
And naturally we've open sourced them.
Read on to find out more about our drush CMI tools.
Drupal 8 FTW: Is it a test or is it a form? Actually, its both
As you'd be aware by now - Drupal 8 features lots of refactoring of form procedural code to object-oriented.
One such refactoring was the way forms are build, validated and executed.
One cool side-effect of this is that you can now build and test a form with a single class.
Yep that's right, the form and the test are one and the same - read on to find out more.
Injecting Dependencies into Drupal 8 plugins
Refactoring Drupal batch API callbacks to increase testability
Drupal's Batch API is great, it allows you to easily perform long running processes with feedback to the user.
But during Drupal 8's development processes it was one of the remaining systems that didn't get the full object oriented, service-based architecture.
Much of the batch API is largely unchanged from Drupal 7.
But that doesn't mean you can't write unit-testable callbacks.
Let's get started.
A quick gotcha with Drupal 8's libraries.info.yml and aggregated JavaScript
This one tripped me up on a recent Drupal 8 project.
Easy to miss when you're working in a development oriented environment with things like JavaScript preprocessing turned off.
A JavaScript file was being added just fine with aggregation turned off, but not getting added with it turned on.
Making Drupal 8's menu active trail consider query arguments
On a recent Drupal 8 client project our client was building listing pages using views exposed filters and adding these to the menu.
This resulted in several menu URLs pointing to the same base path, but with the query arguments determining the difference.
However Drupal 8's default menu-trail calculation was resulting in the menu highlighting all instances when one of them was viewed.
Luckily the active trail calculation is done in a service and it was simple to modify the default behaviour.
Read on to see how we did it.
Native PHPStorm Drupal Test Runner
PHPStorm has a lot of built in test runners, but it doesn't support Drupal's Simpletest test runner. In this blog post we'll see how we can execute Drupal tests inside PHPStorm using Drupal test runner.




