Top Drupal blog posts from June 2022

Twig with green-orange leaves and white petals
Drupal

Like every month, we’re bringing you a round up of our favorite Drupal-related articles from the month before. Here are our top picks from June.

 

Drupal 9.4.0 is available

First up, we have the announcement by Gábor Hojtsy of what’s new in the latest minor Drupal version, 9.4.0. The two most important changes are the inclusion of Olivero as the default front-end theme and Claro as the default back-end theme. 

Other updates include the new experimental Starterkit theme and theme generator, lazy loading config options for image fields, easier permission management and drupal/core-recommended optimizations for managing security updates.

As is tradition, Gábor also includes a section on what this minor release means for site owners still on previous versions, as well as for people contributing modules, themes and translations.

Read more about what’s new in Drupal 9.4.0

 

Meet Bookish, an install profile for static Drupal blogs

The next post from June comes from Samuel Mortenson, the creator of Tome, the static site generation module for Drupal. He presents a new Drupal install profile for static blogs, called Bookish, which is similar to Tome but with streamlined out-of-the-box features.

In his post, Samuel gives a detailed breakdown of the features of Bookish, with some of the most interesting ones being the use of Single File Components for the theme, an image blur-up effect, an image widget for cropping and editing colors, and the inclusion of CKEditor 5.

Read more about Bookish

 

Why Drupal is a Shark

In the third post, Dominique De Cooman of Dropsolid argues that Drupal is more like a shark rather than a dinosaur, since it has been able to adapt to all the transformations the web has undergone in the past 20 years and come out as a winning technology choice today.

A key reason for Drupal’s continued success is the move from a website to a digital experience platform. Drupal is able to thrive here as the top open-source solution for enterprise cases thanks to its commitment to the MACH architecture: microservices, API-first, cloud-native and headless.

Read more about what makes Drupal a shark

 

Pitfalls (and fixes) when lazy-loading images in Drupal

Moving on, we have a post by Mike Herchel exploring the peculiarities of default lazy loading of images introduced in Drupal 9.1. An essential tool here is the new UI for customizing image loading which came in Drupal 9.4.

As Mike points out, the key consideration for lazy loading is whether or not a specific image is displayed above the fold, which developers should keep top of mind when planning the content architecture.

For those wanting additional control, it’s possible to set the correct loading attribute when preprocessing the image field, as well as directly in the Twig template and/or in Views.

Read more about lazy loading in Drupal

 

Drupal 9: Different Update Hooks And When To Use Them

Another prolific author has recently been Philip Norton on his blog #! Code, producing weekly guides for different elements of Drupal 9. The one we’re including this time around is focused on Drupal update hooks, which have a wide range of use cases, including smoothly deploying more complex content changes.

In the article, Philip takes a detailed look at hook_update_N(), hook_post_update_NAME() and the new hook_deploy_NAME(), along with tips and considerations for when (not) to use each one. He finishes with a few additional tips and his own experiences with using hooks, as well as the Drush documentation table on their usage.

Read more about Drupal 9 update hooks

 

Component Libraries in Drupal

Another post from June that we wanted to include comes from Lullabot’s Mateu Aguiló Bosch. He writes about enabling component libraries in Drupal via the suite of component library modules developed by Lullabot, which aim for compatibility between Twig, JavaScript and SCSS.

Up until now, the go-to solution has been to use Twig.js, which has a lot of limitations. Instead of the effort of emulating Drupal in component libraries, Mateu recommends having Drupal render the components on the server. 

This allows the usage of Storybook as the component library, giving the best of both worlds: components that are aligned with Drupal themes and modern development techniques.

Read more about component libraries in Drupal

 

The right way to check for empty content in Twig

We continue with one more post that’s related to Twig, this one written by Mohit Aghera of PreviousNext, who presents the right way for checking for empty content before rendering in Twig.

The problem that arose with the traditional Twig method was Webform submissions being recorded twice, and the second render invalidated the token generated by the Webform handler.

Luckily, there is a pretty straightforward solution: using the set tag in Twig, either in combination with a spaceless filter or alone in a set statement, which ensures that the content only gets rendered one time.

Read more about checking for empty content in Twig

 

Strategic Initiatives Now Have Logos!

The final post from June is more community-oriented, with Shefali Shetty presenting the newly designed logos for each of Drupal’s strategic initiatives and giving some background on their creation. 

A key goal of these new logos is making projects more memorable and impressionable, both within the Drupal community as well as for outsiders, as they will also be invaluable elements of future marketing materials.

The creation of the logos also showcases true Drupal collaboration: the Promote Drupal team worked with initiative leads to get a better feel for the goals behind each initiative, then collaborated with the designer Vinicius Custudio to transform them into logos.

Read more about strategic initiatives logos

 

Two boats at sea in early morning

That’s all for last month's Drupal articles. We hope you enjoyed revisiting them (or discovering them for the first time)!