hook_views_query_substitutions

hook_views_query_substitutions(ViewExecutable $view) Replace special strings in the query before it is executed. The idea is that certain dynamic values can be placed in a query when it is built, and substituted at run-time, allowing the query to be cached and still work correctly when executed. Parameters \Drupal\views\ViewExecutable $view: The View being executed. Return value array An associative array where each key is a string to be replaced, and the corresponding value is its replacemen

hook_views_query_alter

hook_views_query_alter(ViewExecutable $view, QueryPluginBase $query) Alter the query before it is executed. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. QueryPluginBase $query: The query plugin object for the query. See also hook_views_query_substitutions() \Drupal\views\Plugin\views\query\Sql Related topics Hooks Define functions that alter the behavior of Drupal core. File core/modules/views/views.api.php, line 874 Describes hooks and plugins provi

hook_views_pre_view

hook_views_pre_view(ViewExecutable $view, $display_id, array &$args) Alter a view at the very beginning of Views processing. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. string $display_id: The machine name of the active display. array $args: An array of arguments passed into the view. See also \Drupal\views\ViewExecutable Related topics Hooks Def

hook_views_pre_render

hook_views_pre_render(ViewExecutable $view) Act on the view immediately before rendering it. At this point the query has been executed, and the preRender() phase has already happened for handlers, so all data should be available. This hook can be used by themes. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. See also \Drupal\views\ViewExecutable Related

hook_views_pre_execute

hook_views_pre_execute(ViewExecutable $view) Act on the view after the query is built and just before it is executed. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. See also \Drupal\views\ViewExecutable Related topics Hooks Define functions that alter the behavior of Drupal core. File core/modules/views/views.api.php, line 766 Describes hooks and plug

hook_views_pre_build

hook_views_pre_build(ViewExecutable $view) Act on the view before the query is built, but after displays are attached. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. See also \Drupal\views\ViewExecutable Related topics Hooks Define functions that alter the behavior of Drupal core. File core/modules/views/views.api.php, line 720 Describes hooks and plu

hook_views_preview_info_alter

hook_views_preview_info_alter(array &$rows, ViewExecutable $view) Alter the view preview information. The view preview information is optionally displayed when a view is previewed in the administrative UI. It includes query and performance statistics. Parameters array $rows: An associative array with two keys: query: An array of rows suitable for '#type' => 'table', containing information about the query and the display title and path. statistics: An array of rows suitable for '#type'

hook_views_post_render

hook_views_post_render(ViewExecutable $view, &$output, CachePluginBase $cache) Post-process any rendered data. This can be valuable to be able to cache a view and still have some level of dynamic output. In an ideal world, the actual output will include HTML comment-based tokens, and then the post process can replace those tokens. This hook can be used by themes. Example usage. If it is known that the view is a node view and that the primary field will be a nid, you can do something like th

hook_views_post_execute

hook_views_post_execute(ViewExecutable $view) Act on the view immediately after the query has been executed. At this point the query has been executed, but the preRender() phase has not yet happened for handlers. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. See also \Drupal\views\ViewExecutable Related topics Hooks Define functions that alter the beha

hook_views_post_build

hook_views_post_build(ViewExecutable $view) Act on the view immediately after the query is built. Output can be added to the view by setting $view->attachment_before and $view->attachment_after. Parameters \Drupal\views\ViewExecutable $view: The view object about to be processed. See also \Drupal\views\ViewExecutable Related topics Hooks Define functions that alter the behavior of Drupal core. File core/modules/views/views.api.php, line 741 Describes hooks and plugins provided by the