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); ?>
Be Sociable, Share!
Tarik Assagai
Tarik (@tarik916) is a web developer and owner of ACS Digital Media, a Sacramento based web development agency specializing in open source CMS systems. If you are looking for support for your current or upcoming projects, visit www.acs-digital.com.

9 Comments

  1. Great trick very usefull and no other module needed!
    Thank you very much.

  2. 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

  3. 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.

  4. Evelyn /

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

  5. Thanks for this tutorial.

    I do every thing you do but I missed something : my rules have to modify a profile field value but it didn’t (a checkbox).

    I checked “debug mode” in rules, the rules that read my checkbox in profile works well (I try it checking manualy). But another rules have to checked my checkbox didn’t work (the condition is true : webform has been submitted).

    Do you have any idea ?

Leave a Reply