We have a use case in which a Calendar block appears in the sidebar of an Event node (Figure 1). Each node has a specific date set in a Date field.

The purpose of the Calendar block is to allow the user to navigate to a different Event date. We would like for the Calendar month and year to reflect the date of the Event node.

For instance, if the event node URL is example.com/2015-03-24, the Calendar block should default to March 2015. What we find is that on page load, the Calendar block always defaults to the current month and year, irrespective of the node's date.

Is there any setting in the module or in the calendar block view display that could accomplish this functionality?

We tried using Contextual filters, but did not have success.

Figure 1
calendar block

CommentFileSizeAuthor
#2 calendar-block-nav-options2.jpg26.15 KBmikebrooks
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mithesh created an issue. See original summary.

mikebrooks’s picture

Title: Month and year should be month year of active date. » Set Month and year to month year of active date
Issue summary: View changes
FileSize
26.15 KB
mikebrooks’s picture

Title: Set Month and year to month year of active date » Calendar block does not default to month year of node's date
Stephen Ollman’s picture

For those wanting to add a calendar block to the sidebar, I found that adding a BLOCK display output to the view simply didn't work as expected, so my work around was to use the 'Month' page view and using the 'Insert View' filter module created a custom block with [view:view_name=view_display_name] as its content.

NOTE: view_name is the machine name of your view and view_display_name is the machine name of the view display (in the case of using the Month page it should be 'page_month')

I'm looking forward to seeing this module become a full D8 release.

Neslee Canil Pinto’s picture

Status: Active » Closed (outdated)