I want menu items for 'current day, current month and current year to call up the calendar for the current day, month or year. Month is easy as that's what the calendar defaults to so the url is just 'calendar', what arguments do I pass or how do I get current day and year view from menu items?

Comments

Tony Sharpe’s picture

Title: Menu item for current day, month, year » Menu item for current day, month, year - argument validation problem
Category: support » bug

I'm still trying to find away of creating a menu item for 'this year' and 'this day'. I've tried using argument validation but something doesn't seem to be working correctly. I've overridden arguments for the calendar page. Default is still set to 'current date'. Validation is changed to php code as it says in the help text that the argument can be changed by setting $handler->argument, so if I detect the argument as "year" then I should be able to generate the current year from the date function, e.g. "2008", and the same for day. It seems that this works for the page title and navigation but not for the view. Stripping it down to the essentials I've put validation code in as

$handler->argument = "2008";
return TRUE;

From what I understand this should validate and change the argument to "2008". The title and prev/next navigation accept and understand this but the view (generated by calendar-day.tpl.php) still seems to depend on the original argument passed in the url. So, for this example, if I pass the url "calendar/2009" then the title says 2009 and the 'next' link points to 2010 (correct so far) but the page content is year based for 2008. If I use the url "calendar/anything" then the title and nav links are set for year based, 2008 (correct), but the rest of the view is blank. I've tried this for day based as well - just the same. I've tried setting $argument = "2008" in the validation as well - no different.

arlinsandbulte’s picture

Category: bug » support
Status: Active » Fixed

You could set up anther display and override the Argrument, setting granularity to 'week' or 'day'.
Create some additional pages with paths of calendar/this_week and calendar/today.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.