Portland, OR
Faves: Theatre, Pottery, Photography, Podcasts, Beer, Coworking, Mentoring, and Open Source
Recent Episode:
Backend API Integration /
Case Study
Find us in your favorite podcast app.
art & technology
community & work
[lash-ing] verb
1. to secure items together in a somewhat rigid manner
Describe the functionality you want instead of hard coding it.
Would you rather order a sandwich or have to write a step by step tutorial for how to make a sandwich before you can order it?
Fewer moving parts, fewer security patches. Fewer things become obsolete when Drupal gets a major version.
I could walk you through changing things over the phone.
Promotions, deal of the day, move at the speed of thought.
If you have true CI/CD this is less of an issue.
Dries Buytaert
1. when this Event happens
2. if this
Condition is met
3a. do this Action
3b. or do this
Action
before I leave for work
if there are dark clouds in the sky
bring the umbrella from the hall
after I leave for work
if the day is not Friday
get credit card from wallet
purchase coffee with credit card
if the time is before 8:45am
"After 20 minutes of Inactivity,
Remind User of Empty Shopping Cart"
(demo)
"Woah, not sure what this model does..."
"I can edit this message though."
(demo)
What Event?
Saving a node
What Condition?
If it's unpublished
What Action?
Send a message to each commenter
/admin/config/workflow/eca/add
1. Name your Model
2. Add a description
/admin/config/workflow/eca/add
3. Circle = Event
"When this happens..."
4. I have an event,
give it a Name
5. Choose a Template
6. Update content entity
"When *this* happens..."
7. Entity Type = Content
Bundle = Article
Our first
"Action"
Always Start with
Documentation
Templates Once You Sketch Things Out
Keep Sketching
Keep Documenting
Keep Templating
(if you want)
What about unpublished?
This is the "Condition"
from Event-Condition-Action
Event, Condition and Action
...but only emails the first commenter?
I've Pressed Them All
Except One...
Gateway is where
a branch or a loop
starts
Adding the Gateway is the
final form for our Model
to loop over all the comments on a node
"Load Comment" action can only grab one comment at a time, it has no idea how many items are in the list, or what's left
Don't Forget to Save!
In a Perfect World™
We make sure this Node was published and is being unpublished...
(chains / triggers)
1
2
3
4
5
Send email to these users
Trigger another Event on these Comments
Custom View
"Maths"
Views
Arguments
Load Stuff
Do Stuff
New Content
If "ABC" changes
If "DEF" changes
...etc.
Custom Event
Views Bulk Operations
Views Bulk Operations
Access check can be harder
to set up than the Action
Drupal Commerce
Have your store, cart, orders, SKUs react to custom Events
Webform
What about a contest?
Don't allow a judge to edit a submission, but allow them to add notes?
Drupal Remote Dashboard
(Starshot / Drupal CMS)
(AI / APIs)
A Game Engine
drupal.org/project/config_ignore
drupal.org/project/config_readonly
If you want to edit ECA in Production
e.g. Scheduled Publish
ecaguide.org/library/simple/scheduled_publishing
The "Event" is Cron
e.g. Reminder: You haven't edited your profile in a year
https://www.drupal.org/project/eca_vbo
Create Custom Display
Does not play nice with regular VBO
Access Check
Must enable each new Event in View Config
ECA Forms
drupal.org/project/eca_webform
Event: When a form is being validated
Invalidate a form before it gets saved
Validate fields, display custom messages
Don't need to use Form API
Used by Resource Conflict
Check if an event is in the same room at the same time
Use Taxonomy Terms for "rooms"
Can invalidate the form, so it won't be saved if a conflict exists
ECA Workflow
React to changes in Workflow State
e.g. Draft, In Progress, Needs Review, etc.
ECA Cache
Clear Drupal cache bins
Clear CSS/JS cache
Clear the cache of specific views
Clear the cache of specific pages
Clear the cache of specific menus
ECA User
Event when the user account is validated.
drupal.org/project/group_action
Events when a user is added to a group,
Joins/Leaves a group
When group content is added
Show Blocks, Menu Items, Taxonomy Terms, etc.
Ryan Price
ICF
@liberatr