Posted by Annie Rothenberg on September 24, 2010 at 2:51pm
Hi everyone,
I'm very new to this and appreciate any help. I'm struggling to understand contexts, selection rules, visibility, and how to use them all together. What I'd like to be able to do is control whether a pane appears in a panel based on the date of an event. If the event has already happened, I don't want the pane with that event node to appear any longer. I'd also like to be able to control when a pane appears. For instance, I'd like to be able to create a pane in advance, and set it to become visible on a specific date.
Any insight would be very helpful!
Thanks,
Annie
Comments
Since you want to do this
Since you want to do this with data based on the node, pane visibility rules are actually not the best way to do it. Instead, you're best off actually using a view, which will filter the result based on whether or not the conditions are met; if there are no results, the pane will not appear. You can still use context or set an argument to be 'from panel' to specify which node to display if you want the user who adds the pane to the panel to make the decision about the node. And with the latest Panels, you can expose the filters so the date range could be selectable as well.
Another approach
It seems that you want to display upcoming events. If so, you probably won't even have to worry about sending in arguments from Panels -- you could configure Views to display the nearest upcoming event, and then place that view as a pane in the panel.
Alternatively you can configure the view to display only content that have a particular date value between (say) 'now' and '+4 days'. Check out the date filters in Views -- they are quite amazing.
Good luck!
//Johan Falk, NodeOne, Sweden
Thanks so much for the help
Thanks so much for the help and tips, I think I'm starting to grasp how to do what I have in mind!
And thank you!
You have a great habit of posting 'thank you' follow-ups on your questions. That kind of stuff makes it ten times as fun to write answers/comments. Keep up the good work!
I asked this same question in
I asked this same question in the issue list and Merlin was kind enough point me in the right direction! Check this: http://drupal.org/node/915068