Monthly Archives: August 2017

Automatic Redirect by Path in Drupal 8

This example shows how to intercept a Drupal page request, determine if the desired path matches the one we wish to redirect, find the “latest” node of a particular content type, and redirect to that node instead of the original

Tagged with: ,
Posted in Development

Drupal 8 – Formatting a Date Field in Twig

Here are the four easiest ways I’ve found to show dates via Twig inside of a node template. They all result in the same output. Use the field’s formatter settings; include wrappers

This is the only example that includes wrappers.

Tagged with: , ,
Posted in Development

Quick and Dirty Debugging of Drupal 8 Migrations

Introduction If you’re working on a migration in Drupal 8 and you’re finding yourself a little confused by the YAML-based configuration, I strongly recommend using a proper debugger so you can step through the code. You cannot step through the YAML,

Tagged with: , ,
Posted in Development

Database Refreshing Pattern in Drupal 8 – Testing Config Changes

I’ve been working on some Drupal 8 migration work. Given that most of the work I’m doing takes place in “config” I have to keep refreshing/reinstalling the config on my site. For a long time I would use Configuration Installer to

Tagged with: ,
Posted in Development