Drupal Planet

Cache-bust pages containing embedded content

The saying goes, there are two hard problems in computer science: caching, naming things, and off-by-1 errors. While Drupal certainly has not solved the naming things, it has made a valiant attempt at a decent caching strategy. And for the most part it works great, allowing millions of lines of code to load up quickly the vast majority of the time.

This is more a tip about our favorite automation tool, the Events, Conditions, and Actions (ECA) module, and how it can get you out of a bind when Drupal caching goes too far.

Use AI to write alt text for your images

Hot off the presses! A brand new module, AI Image Alt Text, uses your configured AI engine to write Alt text for your images, based on AI vision models. When you turn this on, you get a "Generate with AI" button next to image fields, where you can easily get AI to analyze your image and come up with alternative text.

With some quick tests, I'm finding it's describing the image better than I typically do.

Show a mix of future and past events

Another automation we did for Programming Librarian, a site for librarians to plan educational programs, involved events. They wanted to always feature 3 events on the home page, and the most important events were in the future. If their schedule is full, they wanted 2 future and 1 past event visible -- but they don't always have upcoming events, so there might be 0, 1 or 2 future events, and 3, 2, or 1 past events.

Automatically track documentation requirements

One of our clients is a yacht club that has their own moorage, which they lease out to members. With several hundred slips, their insurance requires them to maintain proof of insurance, up-to-date vessel registrations, and regular electrical inspections for all boats moored at their facility.

In Washington all vessel registrations renew in June, but insurance and inspections can expire any time of year. The office needs to keep copies of these documents on file.

Automatically tag articles

Today, another automation using the Drupal #AI module -- automatically tag your articles.

With the AI module, its AI Automators submodule, and a provider configured, you can add an automation to any field. With a Tag field on your content, you can edit the field definition and "Enable AI Automator". Give it a reasonable prompt, and it will tag your content for you.

Like most of the AI integrations, the great thing is you can easily edit the tags later if you want to highlight something specific, or if it comes up with something inappropriate.