Calendar nav block - help changing link location

Permalink
Hi,

I have the calendar nav block installed which I intend to use as a way of linking to events pages. So far I have the following set up:

> Main Events page with page_list
-> Event 1 Sub Page
-> Event 2 Sub Page
-> etc...

I have also added a custom attribute to the sub page called 'eventdate'.

I have modified the calendar view.php to highlight the pages by the custom page attribute 'eventdate' rather than the default page created date which is working fine.

By default the calendar links to a pre-set listing page in the edit window, however I would like the calendar to link to the event sub page and I am not sure where to edit this if someone could help.

I think this is the area I need to edit but not sure what to replace the document.location with as the code below only seems to link to a single event page (the last one I created).

The line i changed was: top.document.location = '<?php echo $link; ?>';

// handle clicks
   $('.surefyre_calendar_cell').live('click', function(e) {
      var list_page = <?php     echo $listPage; ?>;
      if($(this).is('.surefyre_calendar_highlight')) {
         var id = $(this).attr('id');
         //top.document.location = '<?php  echo DIR_REL;?>/index.php?cID=' + list_page + '&d=' + escape(id);
         top.document.location = '<?php  echo $link; ?>';
      }
   });


The following are set further up the document

// collate dates
$dates = array();
foreach($pages as $page) {
   $nh = Loader::helper('navigation');
   $link = $nh->getLinkToCollection($page);
   $date = preg_replace('/ .*/', '', $page->getAttribute('eventdate')); // drop time portion of datetime
   $dates[$date][] = array($link, $page->vObj->cvName, $page->vObj->cvDescription);
}


I am sure I am just missing something simple, but my php and javascript knowledge is not the best!