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.
Hello,
I'm using a view to populate the global filter and I would like to configure the global filter so that it chooses the first value as the default value.
Since I'm using a view, the first value of the view will vary through time, so I can't configure the global filter by simply selecting a default value in the "global filte defaults" section, i need to use PHP.
How can I select through PHP code the "first view's result"? I need something like
$return $view->results[0];
Thanks!
Comments