Redirect users using Rules, based on a profile field value

This tutorial will take you through the configuration of Rules, Profile module, and Views Bulk Operations (VBO), to create a user redirect. The redirect will depend on a user profile field value. You can use this technique to trigger any action available from rules based on the users profile input.

Required Modules:

Code used in the video:

<?php return ($account->profile_welcome == 0); ?>

7 Comments

  1. Evelyn /

    Hi,

    great tutorial, I was wondering if you could help or perhaps point me in the right direction please. I have a field on my user/*/edit page called paypal_email, I would like to set a page redirect using a truth value. Basically, if the paypal_email field is blank I want to redirect the user.

    I’ve tried the code below but it redirects the user regardless of whether the field is blank. Could you provide any guidance?

    paypal_email == 0) ? ’1′ : ‘ ‘; ?>

    Thanks again,

    Evelyn

  2. Evelyn /

    Seems the code was cut off.

    return ($account->paypal_email == 0) ? ’1′ : ‘ ‘; ?>

    • tarik916 /

      You should be able to use ($account->paypal_email == ”). Since it is not a checkbox field, the default value would not be 0, but would be blank.

  3. Evelyn /

    Thank you so much for your help, that worked perfectly!!

Leave a Reply