Kevin's Blog

All blog entries reflect the opinions of the author and have not been expressly endorsed by the Ivan Allen College of Liberal Arts or the Georgia Institute of Technology.

Drupal Media Library as a Photo Album

Submitted by Kevin on Wed, 06/17/2020 - 14:59

With the release of Drupal 8.7, the built-in Media Library module has become robust enough that it's possible to build some interesting components with it now.  The following gives some semi-technical details for how to configure your own photo album system that takes advantage of the Media Library to handle image uploads and automatic resizing (no more 5 MB files being sent to the browser only to be squished down to 250px X 250px on the screen).

The process is still not super simple and does require at least a little knowledge of doing custom CSS for Drupal.  However, I can imagine someone in the not too distant future creating a third party module to do a lot of this configuration for you, so that anyone can have highly functional photo albums without having to do any under-the-hood coding at all.

Creating a Photo Album System

Step One: Create a Media Type

  1. Under Structure -> Media types, select Add media type

  2. Give your type a useful Name and Description

  3. Select "Image" for Media source

Emergency Alert Infrastucture

Submitted by Kevin on Tue, 03/31/2020 - 17:09

In today's blog post, I will dissect the emergency alerts system I built for my college.  Details are somewhat generic for security reasons, but this should give a clear idea of the infrastructure.

Any emergency alert system is really yet another collection of clients and a server to broadcast messages out.  The key is trying to make the system robust and reliant on a minimum of technologies and connections, so that it stands a decent chance of actually working when it's needed.

Client Architecture

Since all of our major websites run our own implementation of the official Georgia Tech web theme, it seemed most logical to integrate an alert feature into that theme module.  I integrated at the core theme level, allowing the alerts to work with any of our theme implementations (Drupal, WordPress, Omeka, PHP Application).

Hello, Layout Builder!

Submitted by Kevin on Thu, 01/16/2020 - 18:52

In case you've been hiding under a rock for the last year (and I wouldn't blame you if you were), the hot new component being bundled with Drupal 8 is a built-in layout system called "Layout Builder".  For those who've always wanted magazine-like layouts without the overhead of a heavy third-party solution like Panels, this could be your dream come true.

If you've followed my blog and/or work in the past, you'll know that I've been a big proponent of Paragraphs, and I built out the Ivan Allen College of Liberal Arts' Drupal 8 infrastructure on Paragraphs.  That was not at all a bad decision at the time - I did start that work nearly five years ago in Drupal 7 (before Drupal 8 was even released) and Layout Builder itself did not become stable until late 2019.

With everyone talking about how cool Layout Builder is, I finally sat down at the start of this year and began trying to learn how it worked, so I could see how readily I could port over some of my existing Paragraphs based layouts.  I'd put a lot of time and effort into those layouts, and I really hoped I would not have to start over from scratch.

How Not to Run a Conference

Submitted by Kevin on Mon, 09/23/2019 - 14:03

I normally blog about technical topics here, but I'd like to step aside from that for a moment to speak my mind on conference planning.  

I recently attended an IT conference - I'll refrain from giving its name, though some of my readers will be likely to guess - and felt decidedly underwhelmed by it.  I've planned large group events in the past and thus have experience with the process from multiple angles.  Because of that, it really frustrates me to see a conference make easily avoidable mistakes.

I'll also confess that I am an introvert and quietly proud of it, so traditional networking techniques have never worked that well for me, though some definitely work better than others.  A lot of the following relates to how a series of mistakes can lead to an event that is very unwelcoming for introverts like myself.

Render Arrays, Twig, and Drupal 8 Programming

Submitted by Kevin on Fri, 02/22/2019 - 17:39

Over the course of today and yesterday, I went through a pretty amazing journey.

A few years ago, I created a custom Drupal 7 module to generate a block of news headlines that renders in the "featured top" section of a Drupal content page.  When I ported this and other modules over to Drupal 8, I figured out the necessities and got the code working, but I'd left a large chunk of the module in Drupal 7 style or worse.  For example, I was collecting the data for these headlines through direct database queries, which even in Drupal 7 was frowned upon, but figuring out how to pull data from Paragraphs entities the right way had always proved too elusive.  On top of that, my output was generated directly within the block class's build() method, as I'd simply not had time to untangle the inner workings of Twig templates and render arrays.  I knew these techniques were not going to be terribly forward compatible, but they were purposeful quick and dirty kludges to get my sites working.