I am trying to add sidebar blocks according to the date of the event. It should show different ones, when event is in the future and when is in the past.
For adding sidebar blocks I am using Context module. It doesn't support values of CCK date fields as conditions, so I am trying to use Rules to set terms ("past" and "future"), which can be used to define condition in Context.
The problem is, when I try to execute the rule on "Content is going to be viewed" the Context is activated BEFORE the content is loaded (and term applied), so I have to reload page to see the proper result. This of course isn't acceptable. I can't use Rules Scheduler, because I need to use parameters.
I don't know, if I should:
- use PHP reaction to reload the node once more? If so, how to do it properly?
- use integration with Views Bulk Operations and execute the rule on the CRON run? In this case, how to deal with permissions (I heard, that operations performed on the CRON need to be available for Anonymous user)
- do something completely different to accomplish this
Thanks in advance for all suggestions and tips. Please let me know, if you need some more info from me.
Comments
I'd suggest the Context
I'd suggest the Context modulem unless that's whats giving you heck.
You'll have to create two views blocks, but it shouldn't be too complicated.
If your Event Dates are CCK fields, this should be a breeze.
As a filter in each of your views blocks, you can set the Date field to filter on anything less than "Now" and anything greater than "now".
Because "now" is a valid PHP strtotime() statement, it will generate the proper unix time cutoff for your "past" and future" settings.
Hope this helps
Post back if this worked!
I don't understand
Thanks for suggestion, but I don't see how this is solving my problem. I am using this method right now, on my events summary page, but this is different case. Following illustration can perhaps help:
If this is still applicable, please explian further or provide me some link to docs.