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

operinko’s picture

Version: » 7.x-1.x-dev
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.