1

I have a view with exposed filters which only returns results when a filter is applied and it all works fine. I also have a block underneath the view which I only want to show before a filter is applied. I have set the block only to display on a url for example

/view

which is the path of my view, when you apply filters the url path becomes

/view?var=arg

at this point I don't want to display the block

0

Turn on php filter module shipped in core, so to get option to add php codes option to set block visibility at the block configuration.

Remember you have to make sure, php code should be appropriate else it will not allow to access the site till you delete the added php codes from database for the block.

Code which might help you

<?php
  if ($_GET['q'] == 'view' && count($_GET) == 1) {
    return TRUE;  // block will be shown
  }
  return FALSE;
?>
  • i had got so far with the above answer but had missed off && count($_GET) == 1 – Daniel Harper Oct 17 '13 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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