Rules are very important and most common using thing in Drupal. We can create custom rules programmatically using the hook_rules_action_info. There is a useful hook hook_rules_action_info() provided by rules api to create custom rules programmatically. Using this We can use our custom functions to perform the actions that we require.
Drupal Rules
A website will be having two kinds of users mainly, users with administrative privileges and simple users. Most of all a single root user. An administrator one of the main challenge will be in monitoring the site users and its contents. Admin should be notified regarding the new user registration and extra add-ons, etc. For a website with multiple users managing site contents and updates from user roles could become a nightmare.
For a Drupal site I had a requirement to create a Rule using the rules modules. It seemed to be working fine. Then I needed to convert the rule to a programmatic rule that I can include inside my custom module.
Using Drupal 7.x contributed Rules module we can write conditional actions on events. Conditions can be simple or complex. Here we are going to discuss how to write or configure rules conditional action on event validate commerce payment discount coupon.
The first thing to get started is a theme folder. In this case, we’ll call it “base_theme.” The only file actually required to create base_theme is an .info text file which is saved as base_theme.info
Many Drupal users wanted to know how to add an option in the Rules action to clear cached files immediately. Currently they were only presented with the option to clear the Boost cache on the next CRON run. If you are facing the same situation in your Drupal site and would like to know how to add add an option in the Rules action to clear the cache files immediately.
Some Drupal users have realized that Facebook Rules prevents FBOAuth from capturing e-mail addresses in their Drupal website. Uninstalling Facebook Rules brings back the functionality to FBOAuth. If you are encountering a similar issue in your Drupal website then read on to find out more.
If you are getting a "You do not have any administrative items" error message in your Drupal site with the Rules module installed then continue reading to know the solution for removing the error message.
There maybe a scenario in your Drupal website when you would like to create a Rule based Action when a user views a page/url that is not a node. If you want to know how to trigger a Rule when a user views a non-node page in your Drupal website then you need to know the Event for triggering the Action. Read on to find out more.
Many Drupal users have requested for a method to increment a field using rules in their Drupal site. If you are looking for a way to increment a field value using rules in your Drupal site then read on.