actions

Feeds actions

I've been working with Feeds a lot lately. Pretty much in every project I am involved with. I am starting to consider it as an essential piece of Drupal infrastructure whenever external data of any nature is required to be pulled in.

During development and testing, one of the recurring tasks is to clear a bunch of feeds, and then re-import them. Instead of doing these operations on each feed, I thought it would be handy to use good old Views Bulk Operations to clear and import feeds in bulk.

ImageField Archive: an action to download zipped images

One of the recurring requests in the Views Bulk Operations issue queue is to create a downloadable archive of files attached to nodes. While the general case is not trivial to solve, I was recently hired by research on BLOGS to write a more specific action: create a Zip archive of all images stored in imagefields.

Actions REST, a poor man's URI interface to actions

I rely on actions extensively to build functionality in my sites. I find them convenient for business logic because they are packaged chunks of functionality that can be called from many places, including Trigger, Rules, and VBO. Today, I've added a new place where actions can be called: the URL. Actions REST provides this functionality.

Consider a job site where a supplier receives an invitation to participate in a project. The supplier logs on the site and views the invitation, then wants to accept or decline it.

Automatically populating YouTube playlist upon new Embedded Video Field submission

Here's a little action I wrote recently, to automatically populate a specific YouTube playlist as new videos are being posted to a Drupal site, using modules Trigger or Rules. The same concept can also be used retroactively on existing content, using Views Bulk Operations: select all existing video nodes and apply the action to them.

Calling actions manually

Actions are a convenient way to package functionality in reusable chunks that can be called upon specific events. Countless modules expose actions, and at least the following consume them:

  • Trigger
  • Rules
  • Workflow
  • Views Bulk Operations

I found it useful to manually call actions in the business logic as well, typically during form submissions or in hook_nodeapi.

Syndicate content