Adding a Trigger

The trigger module is included with the base distribution of Drupal. However, it is not enabled by default. It must be enabled in Administer | Site building | Modules before it can be used.

Triggers provide a way of linking Drupal events to actions. Much of this chapter has been devoted to creating a new action. Now it is time to take this action and link it to an event.

I r^STX In this chapter we create the trigger through the administration interface. I I In the next chapter we will create a trigger in code. I

The first thing to do is go to Administer | Site building | Triggers. Under the Content tab there should be drop-down boxes for every event that can be triggered:

For each available trigger, there is a drop-down list of actions that may be assigned to that trigger. If there are no actions for that trigger (as is the case with After deleting a post), then no drop-down list is displayed.

A trigger causes an action to be executed when an event occurs. The above screen is used to create a trigger. That is, it provides an interface for correlating an event with an action.

0 0

Post a comment