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.
$view = views_get_view('my_view');
// Get the output for first display.
$view_html = $view->preview('display_1');
// Get the output for 2nd display.
$view_html = $view->preview('display_2');
// $view_html is the same both times!!!
The problem is this line in execute():
if (!empty($this->executed)) {
return TRUE;
}
Because the view is marked as having already been executed, the query for the second display isn't run.
Comments
Comment #1
MustangGB CreditAttribution: MustangGB commentedWhy don't you unset executed then?