Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

How do I redirect the user to some other page, when the view returns empty result?

share|improve this question

1 Answer

up vote 6 down vote accepted

In your views No results behavior Choose ' Global: Text area ' choose php filter and add the following code.

<?php
 drupal_goto('node/1'); //path to redirect
?>
share|improve this answer
Thanks a lot. This is exactly what I did a few minutes ago :) – qasimzee May 24 at 10:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.