I have a pane that I'd like to hide if a URL argument exists.
e.g.
Show the pane if the URL is http://www.mysite.com/
Do not show the pane if the URL is http://www.mysite.com/?page=1 or ?page=2 etc
I've tried a few Visibility Rules:
- Is front page
This shows the pane all the time, NOT hides it all the time
- String: URL Path - Allow access on all pages except the following pages: http://www.mysite.com/?page=1 The pane still shows all the time, even on that specific page
- PHP Code: !isset( $_GET['page'] )
This hides the pane all the time, even without the ?page variable...
Before I go through installing Contexts for this single purpose, I was hoping to simply be able to hide this pane using Panels built-in visibility rules. The ?page= variable comes from using the pager in Views.
Comments
Comment #1
cmarcera commentedMore details:
I added the following PHP Code Visibility Rule to my pane:
Then I created a custom content pane below that with the following code:
In theory, the TRUE/FALSE that the lower pane displays should be the result of the Visibility Rule the upper pane should be following. However when I get a FALSE, the upper pane still displays.
Really baffled on this one...
Comment #2
merlinofchaos commentedI think you want return, not echo.
Comment #3
merlinofchaos commentedHere's a more efficient version that should do what you want:
That will display IF the current URL is home AND there is no pager.
Comment #4
cmarcera commentedThat ended up doing the trick. I only wanted the panes on the first non-paged page. Thanks!
Comment #5
Parzej commented#4 worked for me also. Thx!
Comment #6
cmarcera commentedComment #6.0
cmarcera commentedDetailed some terminology