Drupal Rules and View Bulk Operations

Edit 20140319: There is a great screencast from DrupalCon London about Entity Construction Kit... in that presentation, from about minute 27 to minute 30, the presenter, Jeni Tehan, demonstrates how to create a rule that shows up in the VBO list ( http://youtu.be/hhUuv1cEgVY?t=26m59s ). It is a little more straightforward than the process I outline below. Instead of creating a rule set or an action set as I do, he just creates a rule. Nonetheless, if you've never done this before, check out the three minute video first (and bookmark the video and watch the whole thing later, perhaps :) )

To make a new action with rules that can be used by VBO:

  • Add new rules component
    • make the component an action set or a rule set (if you need conditions, use a rule set. For example, if you want to change a field value, you will need a condition that checks that the entity has the field so that it shows up in the data selector in the action. If you just need to change something not specific to a node type, like changing the comment status, then you just need an action set.)
    • create a variable
    • set the data type as node
    • set the usage to be a parameter (default)
    • Important! Make sure to check 'Configure access for using this component with a permission' and set the permission for the roles that can use this action, unless you only want user 1 to be able to use it!!!
  • then, add whatever actions you want
  • this new action set can then be found in the list of actions in a VBO field

Tags

Internal References

Article Type

General