A few days ago I started a new project on drupal.org: Rules Bonus Pack!
As has previously been discussed, it is a set of modules with 'sandbox' functionality for Rules, that can be used, tested, improved – and also serve as a greenhouse for some features to go into the main Rules project.
I have already updated the project several times, and I expect to add more things every now and then. It contains a lot of things I have been wanting to do with Rules, and is now made much easier. Some examples:
- Set a CCK field without validation (action): This gives you a plain old textfield to enter data into CCK fields. That means that you won't be limited by that pesky node reference field validation, saying that your token isn't a valid node, or by a select list when you actually would like to provide a text value as a token.
- Send e-mail to all users in a user reference field (action): This action mimics the send e-mail to a user action, but does it for all users listed in a user reference field. Useful for sending out updates and other stuff.
- Check number of results from a view (condition): This condition loads a view and checks the number of results – condition is passed if it is at least as many results as you set. You can pass on arguments to the view. Can for example be used for checking if the active user has more than five new messages when logging in, and if so show a message.
- Use Views to load a node (action): This is one of my favourites. This action executes a view of your choice, including arguments you send to it, and loads the first node returned by the view as a new Rules object. I'm currently using it for finding and merging duplicate profiles on a site, but it could be used for a whole lot of things. (Note that you might want to use the previously mentioned condition to check that the view actually has any results.)
- Sum up numbers (action): This provides a sum of a list of numbers you write. Combine with tokens to sum up values in one or more nodes (or other objects).
- Load the acting user (action): Yep – this one loads the global $user object. Easy to do with custom PHP, but you really don't want to have that lying around on a live site.
Three things to note about this project
- It is currently only for Drupal 6. I'm looking forward to learning to code Rules for Drupal 7, but haven't yet found the time.
- I am seeking co-maintainers! If you have some experience coding for Rules and want to join, send me an e-mail and introduce yourself.
- The issue queue is wide open for feature requests. I can't promise anything, but I would very much like to hear your ideas of what you would like to do with Rules that you currently find difficult.
That's it!
Now go over to http://drupal.org/project/rb and try the module!
//Johan Falk
**
Learn Drupal with Nodeone! Drupal 7 introduction | The Views module | Learn Page manager! | Drupal configuration learning curve | Rules for Drupal 6 | Theming Drupal 6 | 49 Drupal 6 modules you should know