Day calendar with a montly calendar on the same page/view

Created on 28 November 2023, 12 months ago

Problem/Motivation

I need to display a small montly calendar on the same view/page that list the events of a day. I managed to create both of them but unfortunately the block with the small calendar doesn't work because it doesn't understand the conditional field used to create the calendar.

Going a little deep, I try to get the value from the URL and pass to the block calendar using some hooks, e.g. hook_views_pre_view, hook_views_pre_build and changing the value to the right format (Ym) with partial success. The value is passed to the block view but the calendar getting crazy with the Previous/Next building the links with the full date (20231101) instead to use 202311.

Also, I've tried the hook_views_query_alter to change the conditional filter when the query is build, without success again. In the back-end, the alter change correctly the conditional field value but the query, again, doesn't work as expected.

So the question is: there's some way to work with both views display on the same page?

Any help/clue will be really appreciated.

I'm attaching a screenshot to provide a better context.

Steps to reproduce

  • Create a new calendar view with two display, one page and one block
  • Link the block display to show the events in the page display
  • Put the block in the page view display template (I'm using the twig_tweak to do that)
  • Try to navigate with the small calendar
💬 Support request
Status

Active

Version

2.0

Component

User interface

Created by

🇧🇪Belgium pmichelazzo Brussels

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024