Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
For various reasons I'm programmatically rendering a view, and would like to be able to programmatically set filters, and then have the Views Data export pick up both the programmatically set filters, and some exposed filter values...
How do this? Is this possible?
My code for the filter setting and rendering:
$view = views_get_view('tin_can_package_answer_statements');
$view->set_display('default');
$filters = $view->display_handler->get_option('filters');
$filters['activity_id']['value'] = $package->course_activity_id;
$view->display_handler->override_option('filters', $filters);
$content = $view->preview('default');
Comments
Comment #2
markusa CreditAttribution: markusa commentedthe views data export display is set to attach to the Master display