Posted by tutumlum on December 30, 2011 at 2:55am
3 followers
Jump to:
| Project: | Calendar |
| Version: | 7.x-3.x-dev |
| Component: | Documentation |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Is there any way to view multiple months at a time like year view? For example, I will set a start month like September 2011 and number of displayed months like 7.
Comments
#1
Anyone any idea?
#2
Hi,
I've had to face the same problem and I've tried to find information on the calendars issue list. As long as I'm doing it on the last drupal 7 calendar version I'm not sure how it extends to drupal 6. To put it in short finally I realized that I could trick the year view in a block and after it overwrite the block template. So:
Then I've overwritten the block template like this:
<div class="months-3-view"><div class="month-1"><?php print $months[1] ?></div>
<div class="month-2"><?php print $months[2] ?></div>
<div class="month-3"><?php print $months[3] ?></div>
</div>
Probably on novembre is not going to show the newt three monts, but only two because of the "year granularity" argument, but I'm not completely sure. I hope it can help others.
Meanwhile I hope the calendar coders may someday provide a new display mode on that fashion :-)
#3
Hi,
the overriden was partially good, it was not taking "current months", but just "fixed". Now it works better:
<div class="view-3-months"><?php $num_month = date('n'); ?>
<div class="month-1"><?php print $months[$num_month] ?></div>
<div class="month-2"><?php print $months[$num_month + 1] ?></div>
<div class="month-3"><?php print $months[$num_month + 2] ?></div>
</div>
It's not going to work when it arrives to november, because the last month it's goint to dissapear and the last 2 months on december. That's because this views preview is considering the whole year as an argument. We still need a calendar views display mode were we could define the first month and number of months ahead.
I leave here that information for anyone that could find it helpful.