Hey this is a really great and flexible module and i am having fun playing around with it. I am having some trouble getting a conditional redirect rule to work though. If anyone could point me in the right direction or give me some advice it would be greatly appreciated. I have listed my problem below.

1. I have two pages both using the login block, one page is called login and the other documents.
2. I only want to redirect the user to the home page when he logs in from the login page and not from the documents page.

I have tried the login destination module to achieve this but the conditional redirect options didn’t work.

Help would be greatly appreciated! Much thanks.

Comments

mitchell’s picture

Status: Active » Fixed

You shouldn't need the login destination module, rules has a page redirect action built in. Start with the event, 'user has logged in', then add a condition for the page they are currently on. This is currently only possible through workarounds described in #442432: Improve textual conditions (starts with, ends with, contains, is equal to, regex) (comments 2 & 3), however a condition may be available in the future as well. Then use the page redirect action, and finally create another rule for the second case as well.

UNarmed’s picture

Hey opensanta thanks a lot for this, im going to give it a try asap =D hopefully it will give me the desired result.

Bilmar’s picture

bookmarking - thanks for the great explanation

UNarmed’s picture

Hey man i am giving this a try now but how do i add the php as a condition to my rule?

UNarmed’s picture

Haha whoops ... i didnt have the PHP filter enabled =/ all sorted out now! Much thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

mitchell’s picture

Component: Miscellaneous » Rules Core

Updated component.