Planet Drupal

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 srcset in static HTML pages: gulp asset build pipeline

Client has a bunch of static landing pages that are mobile-friendly and need to remain that way.

But what is to be done about srcset? Read on, oh reader, for the solution.

First, I created a gulp build task which makes a bunch of different sizes.

Install dependencies like this:
npm install -D gulp-load-plugins gulp-responsive sharp

The task looks like this:

Pages

Subscribe to Planet Drupal