I assume this gets complicated… I have used the carousel as a scrolling agenda: http://www.dehavenkom.nl/agenda.php Obviously it is a bit annoying when the pane goes to January in the middle of the summer :-). Just wonder, is it possible to have it re-directed to the appopriate pane like Tim’s action ‘Redirect between Dates’ - which is for pages of course. Or is there another ‘trick’?
If you made your agenda one month per carousel pane, you could do this pretty simply. Just name each pane something like agenda_04, agenda_05, agenda_12 for the ISO month numbers, and then in PHP you would use date(‘m’,time()) to get the current month in the same format. I’ll dig out the correct bit of JavaScript you’ll need to echo into your page with PHP in an hour or so.
Okay, there’s no way to add the JavaScript that would force the carousel to a particular pane without editing the Action, but there is another trick you can add pretty simply. In your carousel page, open the Page / HTML Markup dialog and move to the Before HTML section. Paste in the following:
What this should do (haven’t tested it here) is read the URI (the entire request string) look for a querystring component, and if there isn’t one, it will add one pointing to the current month in the agenda_NN naming scheme and redirect the page to that URI. This should force the carousel to swing over to that pane.
No, you will need to change it, because you won’t have a pane per month (what the URI is going to ask you for) in that case.
Another thing you could try is to re-write the PHP sample to pick the correct pane based on the current month:
switch(date('m',time()){
case '01':
case '02':
$pane = 'janfeb';
break;
case '03':
case '04':
$pane = 'marapr';
break;
//et cetera
default:
$pane = 'novdec';
break;
}
and then use the same code but substitute $pane in the querystring rather than ‘agenda_’ + the current month. Obviously, change your pane names or the code example above to match one another. All this trick does is force the pane name you add after the ? to be set as the initial selection.
Hmmmm… it sure will make sense to you But I need to do some study first. It will take me a while but that is ok!
I thought I could get away with my design but the client had other thoughts… But I understand he wants it like that…