Introducing: Rules Bonus Pack

Itangalo's picture

A few days ago I started a new project on 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 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


Include features?

Itangalo's picture

I've begun thinking that it might be a good idea to include a bunch of features with example configuration in the Rules Bonus Pack, showing how Rules can be used to achieve a whole lot of things.

Does anyone else think this is a good idea?

//Johan Falk

I think that would be great

caschbre's picture

I think that would be great to see.

Definitely. Examples are

pragnatek's picture

Definitely. Examples are always useful.

AndrzejG's picture

Wow! Taking node count from Views can be used for node creation limiter, which is missing for Drupal 7. Also taking feed-items looks very promising as in many cases they need some post-processing (as for example injecting some default values).

What about stability of 7.x-1.x-dev version? Is it enough to production sites, provided careful usage?

Of course I also opt for examples :-)


Itangalo's picture

I would say that the D7 version could be used (with care) on production sites, but then I probably don't see the flaws in my own code. :-)
I'm gonna keep it in dev for a while more, mostly because it's evolving so rapidly that stable releases doesn't make sense. (It is mostly D6 that get new features every other day, but I hope to pick up some speed on the D7 branch too.)

//Johan Falk


Group organizers

Group categories


Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week