Blog Archives

Alter Date Format in a Drupal 8 Migration

Per https://www.drupal.org/node/2820490 you can now use the format_date plugin to alter date formats like this:

I do always recommend using skip_on_empty before any other process plugins.

Tagged with: , ,
Posted in Development

Link to a View (with Contextual Filter value) If It Will Have Results (Drupal 8)

Returns a link render array.

Tagged with:
Posted in Development

Drupal Views – Show One (Most Recent) Item Per Group

Alright, the title is a bit misleading because I’m not using Groups, but it is the best explanation of what I’m achieving with this example. My goal is to show a list of the most recent blog post in each category, where

Tagged with: , , ,
Posted in Development

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

Lathe Stand Plans

Here’s my 5-foot adaptation of the lathe stand from https://www.youtube.com/watch?v=MJZycw5NUF8 (Thanks Keith!) Here’s what it took for supplies: (1) 4×8  3/4 birch plywood (7) 2×6-8ft (3) 50lb bags of sand (had to fill trash 4 trash bags because 50lb bags too big)

Tagged with: , , ,
Posted in DIY, Woodworking

Bookmark with Dynamic Components via Keyboard Maestro (with Toggl Reports example)

Here’s an example of how you can use Keyboard Maestro to create bookmarks that use dynamic components. For this example I wanted to create a bookmark that would give me the correct URL to get a report of the last

Tagged with: , , , ,
Posted in Tech Tips

Adding Entity Wrapper Class from Field Value using Display Suite

NOTICE: This works fine in Drupal 7. For Drupal 8 please see https://www.drupal.org/node/2863420 Sometimes as a developer you need to provide your Drupal authors with the ability to choose different variations of a particular content object. For example, imagine you have a Callout paragraph bundle

Tagged with: , , , ,
Posted in Tech Tips