Previous related posts:
By default the day links inside the mini calendar block will redirect you to the calendar day view of that day.
Sometimes we would like that link to be another view display such as a view which list all the events of a specific day. In that case, we have to customize the calendar datebox template file which is located @ theme/calendar-datebox.tpl.php inside the calendar module folder. Copy this file to your theme folder and edit it as follow.
<?php // $Id: calendar-datebox.tpl.php,v 1.2.2.3 2010/11/21 14:15:32 karens Exp $ /** * @file * Template to display the date box in a calendar. * * - $view: The view. * - $granularity: The type of calendar this box is in -- year, month, day, or week. * - $mini: Whether or not this is a mini calendar. * - $class: The class for this box -- mini-on, mini-off, or day. * - $day: The day of the month. * - $date: The current date, in the form YYYY-MM-DD. * - $link: A formatted link to the calendar day view for this day. * - $url: The url to the calendar day view for this day. * - $selected: Whether or not this day has any items. * - $items: An array of items for this day. */ ?> <!--div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $selected ? $link : $day; ?> </div--> <?php if ($selected) { $output = l($day, 'events/' . $date); } else { $output = $day; } ?> <div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $output; ?> </div>
Clear cache and reload the page and you will see the link is now pointing to the events url.
Done =)
Reference:
How redirect to EDIT node at this date?
e.g. link like: node/[…]/edit
LikeLike
Then you need to customize the the following highlighted line.
But i am not sure how you could get the node ID in the .tpl.php.
LikeLike
It solved my problem! thank u very much for posting code snippets!
LikeLike
you are welcome. =D
LikeLike
<div class=" ">
This helped me add a node in the calendar box, using a drupal calendar view
LikeLike
Thanks for ur code but i couldn’t restore it. Could u please follow the Syntax Highlight and post it again. =)
LikeLike
How do I link the mini calendar date to a Month display?
LikeLike
Just modify the calendar-datebox.tpl.php and set the $output to the month display.
LikeLike