Commit 569babbc authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-4704: changing hook to remove exposed filters

parent 4508add5
......@@ -5,16 +5,17 @@
* Provides configuration and settings for events.
*/
use Drupal\views\ViewExecutable;
/**
* Implements hook_preprocess_block().
*
* Remove the exposed widgets from the view/block for events.
* Implements hook_views_pre_render();
*/
function uw_ct_event_preprocess_block($variables) {
// If we are on a events listing, remove the exposed widgets.
if (isset($variables['derivative_plugin_id']) && $variables['derivative_plugin_id'] == 'uw_view_events-events_listing_block') {
// Remove the exposed widgets from the view/block.
unset($variables['content']['#view']->exposed_widgets);
function uw_ct_event_views_pre_render(ViewExecutable $view) {
// Remove exposed filters on block listing view.
if ($view->id() == 'uw_view_events' &&
$view->getTitle() == 'Event listing') {
unset($view->exposed_widgets);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment