I'm using D6 with the 6.x-2.x-dev version of the Calendar module and I'm trying to make the day numbers in the month view be hyperlinked to that day's day view. In order to do this, I *think* I need to override the theme for the month view, but upon doing this, I discovered that the output for the month view is nothing more than a big string variable.

Where would I add the linking code to do this? Will this be a preprocessor thing or is it going to be done through the Views interface in the admin area?

Please feel free to be as elaborate as you wish and thank you so much for making this cool module. It's awesome!

Comments

Wolf_22’s picture

I found a way to do this--so please let me know if what I've done here is wrong:

Instead of the previous file I copied-and-pasted into my theme directory, I instead copied-and-pasted calendar-month-col.tpl.php into the theme directory to override it and simply added hyperlink code around the output but used $item['date'] as the src attr. for the link.

My only concern with doing this is making the code add a hyperlink around an already-generated hyperlink for those days which have events, etc.

Anyone know of a better way to do what I'm trying to do here?

Wolf_22’s picture

Here's what I decided to use:

<?php
/**
 * @file
 * Template to display a column
 * 
 * - $item: The item to render within a td element.
 */
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
$date = (isset($item['date'])) ? 'date="' . $item['date'] . '" ' : '';
?>

<td <?php print $id?>class="<?php print $item['class'] ?>" colspan="<?php print $item['colspan'] ?>" rowspan="<?php print $item['rowspan'] ?>"<?php print $date ?>>
  <div class="inner">
    <?php //print $item['entry'] ?>
	<?php 
		if($item['item']):
			print $item['entry'];
		else:
			print '<a href="calendar/'.$item['date'].'" title="">'.$item['entry'].'</a>'; 
		endif;
		
	?>
  </div>
</td>
Neslee Canil Pinto’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

The D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.