I’m trying to work with @bastianallgeier’s calendar plugin and got a little bit lost. Any help would be highly appreciated !
The calendar will have maximum of one post per day, but not every day will have posts. The days that don’t have posts can get the same class inactive to keep the day structure. I attached a sketch from the design for visual reference.
— The first thing I’m trying to do is some sort of if / foreach that checks if there are posts in the month and if so, display a new month on the page (if posts in July > show July month. If no posts in the month > don’t show). Each new month will go on top (flip() somehow?).
— The second thing I’m trying to do is when hover a date to change the background of the page with an image from that day post. A little bit lost how to fetch the data from the custom field in panel. I’m getting contents using something like this:
I also tried to use this recently to drive an events calendar, and struggled to get it to do what I wanted. I ended up using JQuery based (https://fullcalendar.io) and populating it dynamically with Kirby. Should be easy enough to use the plugins options and CSS to get the design you want.
Once you’ve got that calendar setup and working on you page, you can populate it like this:
This is an events calendar, so i had custom fields set in my blue print to capture start and end dates. The events are simply sub-pages to the events section. When you click on the event on the calendar, it will take you through to that page:
You need a loop that goes through all the months you want to show on the page (from - to). Then you need a function that filters all pages for that month and checks if there are any. If so, the month is shown.
$item->featuredimage() only get’s the name of the image file, you need to create an image object:
$img = $item->featuredimage()->toFile();
But I doubt that loop makes sense here, because you don’t want to get all images, do you? What you want to do is fetch that image via Ajax on hover event.