Drupal 6.16
Calendar 6x-2.2 (with calendar Popup module enabled)
Views 6x-2.10

The following code displays events for the current date in the calendar view header. Problem is that I can not get the event's detail popup to display event node teaser like it does from the calendar month view. When the link in the header is clicked the popup opens but is empty.

Any suggestions on how to get this to work?

Thanks!

<?php
//date_now() is a Drupal function which accounts for user selected time zone.
$today_date = strtotime(date_now() ->format("Y-m-d"));
// load view object
$view = views_get_current_view();
// execute view query
$view->execute();
foreach ( $view->result as $result ) {
 $event_date = strtotime($result->node_data_field_spec_event_date_field_spec_event_date_value);
  if ($event_date == $today_date) {
   print "<b>$result->node_title</b><br />";
   print '<a class="popup" href="http://example.com/node/' . $result->nid . '"><b>' . $result->node_title . '</b></a><br />';
print '<br />';
 }
}
?>

Comments

WiredEscape’s picture

Found the following code in '\modules\calendar\jcalendar\jcalendar.js' which creates the popup which display node content in bubble.

Could someone explain how the NodeID and ItemID vars are being grabbed by this JS in the calendar view but are not accessible from within the view header?

What do I need to add to code in view header to make this JS work on the link in the view header?

Much appreciated!

      // Get NodeID and ItemID
      var ids = $(this).parent().parent().attr('id');
      var arr = ids.split(":");
      var nid = arr[1];
      var id = arr[4];
            
      // fill the div with data
      $.ajax({
        type: "GET",
        url: var_base_path + "?q=jcalendar/getnode/"+nid+"/"+ids,
        success: function(msg){
          domCallback(msg);
        }
      });
NickDickinsonWilde’s picture

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

6.x is entirely unmaintained.