Skip to main content
Start of main content.

lee.rowlands

Lee Rowlands
Senior Developer

Location

Bundaberg

Drupal.org

larowlan

Twitter

larowlan

Lee has 22 years professional development experience with PHP, is a member of the Drupal.org security team and maintains the forum, comment, contact, contextual and block content modules in Drupal core along with at least 30 contrib projects. He is also the framework manager for core.

My blog posts

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.

by lee.rowlands /

Making Drupal 8 datetime widgets use human formats

Drupal 8 includes a datetime field type and widget out of the box.

The widget uses the HTML5 date element on supported browsers, providing a polyfill to a text field with jQuery UI's datepicker for browsers that don't yet support HTML5 date inputs.

However - HTML5 date formats always work in ISO8601 format - ie YYYY-MM-DD - which isn't very user-friendly for those using Firefox and Internet Explorer.

Luckily, with a few tweaks you can easily swap this into DD/MM/YYYY format for those browsers and then switch it back server side into the format Drupal expects.

 

by lee.rowlands /

Overriding services in Drupal 8 - advanced cases

Drupal 8 comes with a services based architecture allowing clean dependency injection, separation of concerns and another way to modify how Drupal works without hacking core

You've probably heard that Drupal 8 lets you swap out a core service for your own implementation, hey, I even said it myself here and here, but how do you achieve that?

Read on to find out how to manipulate Drupal 8 services at run-time and how this compares to other popular PHP Frameworks like Laravel, Silex and Symfony

by lee.rowlands /

To Alter or Dispatch: Drupal 8 Events versus Alter Hooks

Drupal 8 comes with two extension points for module developers to allow other modules to interact with their code.

The trusty alter hook, the linchpin of Drupal versions past is still there - allowing other modules to interact and intervene in the behaviour of your module.

But there is a new kid on the block, the event system.

So as a module developer how do you decide whether to use the alter system or the event system.

by lee.rowlands /

Drupal 8 Critical Office hours

In an effort to continue the velocity of work on Drupal 8 criticals from the Ghent criticals sprint, we've taken it upon ourselves to get together for at least one hour each Friday to focus on Drupal 8 criticals

Read on to find out what we got up to in the first week, but also how you can get involved.

by lee.rowlands /