// $view_array variable, since contextual_preprocess() requires that they
// be attached to an array (not an object) in order to process them. For
// our purposes, it doesn't matter what we attach them to, since once they
// are processed by contextual_preprocess() they will appear in the
// $title_suffix variable (which we will then render in
// views-view.html.twig).
$view->
setDisplay($element['#display_id'
]);
// Add the result of the executed view as a child element so any
// #pre_render elements for the view will get processed. A #pre_render
// element cannot be added to the main element as this is already inside
// a #pre_render callback.
$element['view_build'
] =
$view->
executeDisplay($element['#display_id'
],
$element['#arguments'
]);
if (isset($element['view_build'
]['#title'
])) { $element['#title'
] = &
$element['view_build'
]['#title'
];
} if (empty($view->display_handler->
getPluginDefinition()['returns_response'
])) { // views_add_contextual_links() needs the following information in
// order to be attached to the view.
$element['#view_id'
] =
$view->storage->
id();
$element['#view_display_show_admin_links'
] =
$view->
getShowAdminLinks();
$element['#view_display_plugin_id'
] =
$view->display_handler->
getPluginId();