Drupal Rules module, a swiss army knife for Drupal

In the Drupal universe there are a lot of modules that can help you in an enormous number of situations. The most well known examples of these modules are CCK, Views and Panels.

 

Rules is another one of those modules. Rules is a Drupal 6 module and is largely based on the Workflow NG module in Drupal 5.

 

One of the things that you can do with Rules is to make a workflow for when someone logs in. In Drupal when you log in you stay on the same page. So when you log in using the log in page, you will end up in your user profile. This might be the right kind of behavior for your Community website, but for a company website where the website editor logs in it is pretty much useless for this user to end up on his profile page.

 

An easy solution would be to theme the profile page as a dashboard page where the user can create content, etcetera. A better solution is to redirect the user to dashboard page after the user logged in. The rules module can do this without the need for writing PHP code.

 

In Rules you can make a rule that gets activated on a trigger and that will fire an action. In the example above "logging in" is the trigger and "redirect to dashboard page" is the action. But Rules can do much more.

 

There exist a number of triggers like "comment posted", "node created", "node deleted", "user registered". There also exist a number of actions "mail user", "log to watchdog", "schedule another rule in the future", "block a user", etcetera.

 

Besides actions and triggers there also are conditions, a condition makes it possible when a trigger is fired that also a condition has to be true before the action is fired. An example of a condition is "content type", "user role".

 

Besides redirecting after logging in you can make Rules for e-mailing all users of the "translators" role when new content has been created. Schedule an action in the future to mail you when you did not publish a created node. Etcetera.

 

And because it is a Drupal module... Other modules can work together with Rules. So much more possibilities are available!!

 

Below is a screenshot of a rule that redirects the user of role "editor" to a dashboard page.

Login_Redirect_Rule.png

2 bezoekers hadden een reactie

  • 1. Door Jim (not verified) 10 Apr, 2009 | Added to DrupalSightings.com
     
  • 2. Door Johnny 15 Apr, 2009 | thanks!
     

    thanks!

  • Post new comment

    The content of this field is kept private and will not be shown publicly.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <br> <br/> <p> <img>
    • Lines and paragraphs break automatically.
    • Web page addresses and e-mail addresses turn into links automatically.