ECA

Automating all the things - 24 ideas for things you can automate with your website
Last December I wrote up 24 specific things we've automated on Drupal, and published them as an Advent Calender -- one little nugget each day.

Unleashing the power of ECA: No-code coding for ambitious site builders
Last year I gave a presentation at DrupalCon about automating things using the powerful ECA Module. Here's the recording!

Creating Product Bundles in Drupal Commerce
As we start developing mini-products to offer to our clients, we've found we actually need to group multiple products under one purchase.

Ask Freelock: ECA vs Rules
Yesterday a client asked us to install Rules module (again, repeating an earlier request, when he had missed my answer that we had installed ECA instead).
Day 23 - 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:
Day 22 - Automatically set fields on content
One of the easiest things to do with the Events, Conditions, and Actions (ECA) module is to set values on fields. You can populate forms with names and addresses from a user's profile. You can set date values to offsets from the current time. You can perform calculations and store the result in a summary field, which can make using them in views much more straightforward.
Day 19 - Add conflict detection on registration forms
Our Yacht Club client has three workslips that members can reserve for up to 3 days. Using core taxonomy, content types, views, and the Events, Conditions, and Actions (ECA) module, we built a system to allow members to make reservations, and have the system prevent double-bookings.
Day 16 - Build a membership application system
Drupal, with the Events, Conditions, and Actions (ECA) module can build up sophisticated applications without a single line of custom code. You can build full applications using a handful of Drupal modules.
Day 15 - Automatically post to Mastodon or other remote APIs
The ECA Helper module provides an action to make an arbitrary HTTP post to any URL. That's all that's necessary to post to Mastodon from Drupal, if you have a Mastodon account. I've been using this functionality to automatically post these advent calendar posts for the past week.
Day 13 - 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.
Day 11 - 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.
Day 8 - Automatically show future and past events in a region
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.







