3

It's not a "new" issue, but I'd like to implement a year + month dropdown selector to navigate a standard calendar view's display, as this particular calendar shows historical entries spanning many years, all of which need to be directly accessible.

I understand it's possible to specify an argument via URL to control the calendar view's current display through its contextual filter. However, I don't know how to supply this argument via a dropdown, either in the block itself or another (similar to an exposed filter), in a way that would function properly in all cases.

Working without a solution, I created my own views style plugin, added an exposed filter, and am now going to look for a way to display the easily filtered-by-month results in a custom calendar implementation through my code.

Hopefully there's a way to make use of the existing calendar module via "inspired" filtering, instead of my custom plugin route?

Any guidance would be appreciated.

0

I had the same requirement a few time ago.You are right the key is date pager in url to navigate through date/month/year

here is a workaround I did,might be helpfull in your case too.

As in brief I created custom form with field as month and year.Submission of the form navigates passing the selected month and year in url using drupal_goto() and we are calling this form in views header.

  • Thanks! I managed to get this approach to work, which is sufficient for now. However, the ideal is a little bit more complicated. My calendar is in a block (without a page), and this approach would have to redirect to a static location. I'm going to look into how the existing pager updates the view without leaving the page, and see if I can implement the argument similarly. – C.P.T. Oct 3 '13 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.