Error: no mixin named container or border-box-sizing

It can be hard to tell why a mixin fails in a sass file. After all, if the mixin isn't included in your dependencies automatically as it was before, grepping for it in the files won't turn up anything.

I was using a child theme of Classy, running Drupal 8. It turns out that this particular generically-named mixin comes from susy 2.x, having been removed in susy 3.x.

I fixed this by setting the susy version number like so in package.json:

8: Disable Caption on Specific Entity Embed Types in CkEditor

I had a devil of a time figuring out where captioning was coming from on my entity embeds.

Another team member had set it up, and I was just kind of baffled as to why captions were being offered on my entity embed forms.

It turns out that if you turn on captioning, you just get it for free on all of your embeds, and it's not configurable.

But... I don't want it for free!

Bah. Humbug. This free software doesn't have the features I think it should.

Alright, so here's how you turn off captioning:

8: Programatically Filter Current Nid from Views Block Listing

Views has a setting to exclude the current nid from the URL from the listing one is currently viewing. This is essential when you have, say, a list of related nodes that are are defined by a category that includes the current node. If you don't exclude the current node, your current node will be listed in the "related content" block on itself. Well, obviously one is related to oneself, one thinks.

First, I tired to accomplish this through the UI with these steps, below.

Add Multi-Element Wrapper Class With CKEditor in Drupal 8

The task at hand here is to allow the client to create a classed wrapper around multiple elements using CKEditor in Drupal 8.

The fundamental problem here is the CKEditor's built in "Styles" dropdown classes each <p> individually, while we need a class wrapping them.

You could probably make or install your own CKEditor plugin, but that's not what I did.

I did this with Javascript.

Drupal 8.4x: Add Timezone to Date or DateRange Field

Here's the controlling issue for adding timezone support to Drupal core. As of now, August 1st, 2017, it doesn't appear to be ready.

Instead, I just added a timezone field to the node using the Timezone module, then appended it to the date range on field preprocess.

This won't work for you if you have multiple dates on an entity with different timezones (you might want to try the patch linked above), but it will fit most use cases.

Drupal 8: Get URI, Title, and Alt from Media Entity Reference Item

Over the last several days, I've railed in my head against the matroshka structure of Drupal entities. But when I tried to break out some helper functions, and when I realized what each of the different properties each entity had, I realized the complexities of entities were warranted. Life is complex, and thus Drupal is complex.

Entity references load a Media Entity, which load an Image from an image field, which load a File. The alt and title are on the Image, while the file URI is on the file.