Drupal Planet

Automatically Geolocate Santa


We've reached the last day of the calendar, and it's time for Santa's visit! Santa has been visiting some famous places all month. With the Geocoder module, Leaflet, a Geofield, and an Address field, you can automatically put each address Santa has visited on the map!

You do need to configure a geocoder source. We're using OpenStreetmap, from the geocoder-php/nominatim-provider.

Read More
ECA model showing how to pull in an AI Chat action to moderate comments on a website

Automatically moderate comments using AI


When you allow the general Internet to post comments, or any other kind of content, you're inviting spam and abuse. We see far more spam comments than anything relevant or useful -- but when there is something relevant or useful, we want to hear it!

With the AI module and the Events, Conditions, and Actions module, you can set up automatic comment moderation.

Like any use of AI, setting an appropriate prompt is crucial to getting a decent result. Here's the one we're trying out:

Read More
Flowchart showing a process with decision and action steps connected by arrows.

Automatically post to BlueSky


Since the 2024 election, the BlueSky social network has exploded in popularity, and appears to be replacing the cesspool that used to be Twitter. I'm not much of a social media person -- I much prefer hanging out in smaller spaces with people with shared interests. If you're like me, I would highly recommend finding a Mastodon server that caters to your interests, where you're sure to find rewarding conversations.

Read More
Flowchart for Salesforce Case ECA Model, showing various process steps and connections.

Make integrations with other services more resilient using a Queue


One downside of automating things is dealing with outages. Sometimes services go down, and are not available for some period of time. When this happens, how does it impact your automation?

If you don't design your automation carefully, you might lose the data entirely. Or get spammed by hundreds of submissions when it comes back up. Handling this correctly does end up needing some understanding of how the automation works, as well as any quirks of the remote system.

Read More
Flowchart with selection user, producer core, and custom trigger nodes.

Automatically update a spreadsheet of active products


One of our e-commerce clients has several thousand active products. As a distributor, their clients are retailers, some of which like having an up-to-date product spreadsheet.

Using the Events, Conditions, and Actions (ECA) module along with a Views Data Export view of all products, we created a view of all the relevant fields that exports a spreadsheet of all their products, and saves it in their private media system once per day.

Read More
ECA model that changes the view mode of an item after a date value goes into the past

Change the display of an event after it happens


Event Calendars seem to be very common on the Drupal sites we build. One of the best ways of improving engagement on a site is to add content about the event after it happens. People who attended an event might come back for a recap, or to see pictures or notes from other participants, while people who did not attend can get a sense of what a future event might be like based on your past events.

Read More
ECA model showing a portal page event, the detail around setting the max-age cache header to 0, and the page cache kill switch.

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.

Read More