Change class name view-grid as default if no ?display= in the URL
Fixed the issue of unable to change sort dropdown of Search Result Pager
This commit is contained in:
parent
9836edfb58
commit
8ec130bf8e
2 changed files with 17 additions and 1 deletions
|
|
@ -126,7 +126,7 @@ function islandora_advanced_search_preprocess_views_view(&$variables) {
|
|||
// has been created for.
|
||||
if (in_array([$view->id(), $view->current_display], $views)) {
|
||||
// Toggle between 'list' and 'grid' display depending on url parameter.
|
||||
$format = \Drupal::request()->query->get('display') ?? 'list';
|
||||
$format = \Drupal::request()->query->get('display') ?? 'grid';
|
||||
$variables['attributes']['class'][] = "view-{$format}";
|
||||
$view->element['#attached']['library'][] = 'islandora_advanced_search/advanced.search.pager';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue