Closed (fixed)
Project:
Views TimelineJS integration
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
26 Sep 2012 at 19:43 UTC
Updated:
22 Nov 2012 at 11:30 UTC
Instead of displaying nothing, we can just display the array using print_r(), like this:
return '<pre>'.print_r($data, 1).'</pre>';
Be sure to put the computation of $data outside the outer if, example:
// Output results as JSON data to feed TimelineJS library
$data = array(
'timeline' => array(
'headline' => $this->options['timeline_config']['headline'],
'text' => $this->options['timeline_config']['text'],
'type' => 'default',
'date' => $rows,
),
);
// Skip rendering if view is being edited or previewed
if(!$view->editing) {
if(isset($this->view->json)) {
return drupal_json_encode($data);
}
else {
// Output wrapper markup and include JS libraries
return theme('views_timelinejs', array('view' => $view, 'options' => $this->options, 'rows' => $rows));
}
}
else {
return '<pre>'.print_r($data, 1).'</pre>';
}
Comments
Comment #1
operinko commented