« Add a block view that leverages node references using views arguments | Main | Formatting the Gazetteer »

January 13, 2010

Redirect to a data use agreement before download

One of the capabilities our new website will require is the ability to force users to agree to our Data Use Agreement before downloading a data file. I have gotten part of the way to that goal with the steps I outline below.

Here are resources that may be helpful:

Drupal's workflow module
Drupal's actions module
A previous blog post of mine.

Creating a redirect rule

- Install the rules module

- Go to Administer > Rules > Triggered Rules > Add a new rule

- Label: Redirect to Data Use Agreement
- Event: Content is going to be viewed

- Add a condition > Content has type > Next
- Under Content Types: Select Data File

- Add an action > System > Page redirect > Next
- Under To: node/95 (points to data policy) > Save

Now, when you try to view a Data File page you will be redirected to the data policy. Ideally, the next step would be to place a button on the policy page that users would click if they agreed to abide by the policy terms. Upon clicking, they would be sent to the desired data file.

The trick is to retain the desired page (i.e., the data file) and to set another rule that directs the user to the data file. Of course, when this second rule (policy to data file) is implemented, it needs to override rule 1 (data file to policy) otherwise some sick infinite loop would be started.

To be continued...

Posted by kkwaiser at January 13, 2010 11:15 AM

Comments

Login to leave a comment. Create a new account.