diff --git a/themes/bootstrap3/templates/RecordTab/collectionlist.phtml b/themes/bootstrap3/templates/RecordTab/collectionlist.phtml index f124aeb16e0c590e14f9a777b07241e1b255a558..22460757bddd29f9f79e5d01b7177a3a96cfbc4b 100644 --- a/themes/bootstrap3/templates/RecordTab/collectionlist.phtml +++ b/themes/bootstrap3/templates/RecordTab/collectionlist.phtml @@ -6,6 +6,9 @@ $results = $this->tab->getResults(); $params = $this->tab->getParams(); $searchDetails = ['results' => $results, 'params' => $params, 'indexStart' => 1]; + + $filterList = $params->getFilterList(false); + $checkboxFilters = $params->getCheckboxFacets(); ?> <div class="<?=$this->layoutClass('mainbody')?>"> <?php if (($recordTotal = $results->getResultTotal()) > 0): // only display these at very top if we have results ?> @@ -42,11 +45,15 @@ </div> </div> - <?php if (!empty($params->getFilterList(false))): ?> + + <?php if ($filterList || $checkboxFilters): ?> <?=$this->render('search/filters.phtml', [ - 'params' => $params, 'urlQuery' => $results->getUrlQuery(), + 'filterList' => $filterList, + 'checkboxFilters' => $checkboxFilters, + 'searchClassId' => $this->searchClassId, + 'searchType' => 'basic', ] ); ?> <?php endif; ?> diff --git a/themes/bootstrap3/templates/combined/results.phtml b/themes/bootstrap3/templates/combined/results.phtml index 0a552a622f9d99bea7036bf4166c2a2320ac8114..01c5a707b00b7c0fc89eadc24bf2bed4a19ddb54 100644 --- a/themes/bootstrap3/templates/combined/results.phtml +++ b/themes/bootstrap3/templates/combined/results.phtml @@ -17,7 +17,7 @@ 'searchId' => $this->results->getSearchId(), 'searchClassId' => $this->params->getSearchClassId(), 'checkboxFilters' => $this->params->getCheckboxFacets(), - 'filterList' => $this->params->getFilters(), + 'filterList' => $this->params->getFilterList(), 'hasDefaultsApplied' => $this->params->hasDefaultsApplied(), 'selectedShards' => $this->params->getSelectedShards() ] diff --git a/themes/bootstrap3/templates/search/filters.phtml b/themes/bootstrap3/templates/search/filters.phtml index ef4e5274109a4630d59031165c73adc135b59109..30286c0dc8d811d5f0b250fba31fcb1976f1ede9 100644 --- a/themes/bootstrap3/templates/search/filters.phtml +++ b/themes/bootstrap3/templates/search/filters.phtml @@ -7,10 +7,8 @@ $params = clone $this->params; } - $filterList = $params->getFilterList(true); - $checkboxFilters = $params->getCheckboxFacets(); - $lastSort = $this->searchMemory()->getLastSort($params->getSearchClassId()); - $options = $this->searchOptions($params->getSearchClassId()); + $lastSort = $this->searchMemory()->getLastSort($this->searchClassId); + $options = $this->searchOptions($this->searchClassId); $hasDefaultsApplied = $params->hasDefaultsApplied(); $filterCount = $this->searchbox()->getFilterCount($checkboxFilters, $filterList); @@ -25,7 +23,7 @@ } } - $advancedSearch = $params->getSearchType() === 'advanced'; + $advancedSearch = $this->searchType === 'advanced'; ?> <?php ob_start(); ?> <?php foreach ($checkboxFilters as $filter): ?> diff --git a/themes/bootstrap3/templates/search/results.phtml b/themes/bootstrap3/templates/search/results.phtml index 5f6f4be0df1e59b0a4d3fd7181d2ed4a580c9244..76b09cb00e7644c7a536745a67e537c686657d4c 100644 --- a/themes/bootstrap3/templates/search/results.phtml +++ b/themes/bootstrap3/templates/search/results.phtml @@ -17,7 +17,7 @@ 'searchId' => $this->results->getSearchId(), 'searchClassId' => $this->params->getSearchClassId(), 'checkboxFilters' => $this->params->getCheckboxFacets(), - 'filterList' => $this->params->getFilters(), + 'filterList' => $this->params->getFilterList(), 'hasDefaultsApplied' => $this->params->hasDefaultsApplied(), 'selectedShards' => $this->params->getSelectedShards(), 'ignoreHiddenFiltersInRequest' => isset($this->ignoreHiddenFiltersInRequest) ? $this->ignoreHiddenFiltersInRequest : false, diff --git a/themes/bootstrap3/templates/search/searchbox.phtml b/themes/bootstrap3/templates/search/searchbox.phtml index 75fd6c9e65b9941aaa88f606fba8a7d04fa1fd80..1a03f5753dc5181447eb507cd61acc9a12dcf803 100644 --- a/themes/bootstrap3/templates/search/searchbox.phtml +++ b/themes/bootstrap3/templates/search/searchbox.phtml @@ -36,6 +36,7 @@ $checkboxFilters = is_array($this->checkboxFilters) ? $this->checkboxFilters : []; } $filterDetails = $this->searchbox()->getFilterDetails($filterList, $checkboxFilters); + $showFilters = $filterDetails && (isset($results) || $options->getRetainFilterSetting()); ?> <?php $tabConfig = $this->searchTabs()->getTabConfig($this->searchClassId, $this->lookfor, $this->searchIndex, $this->searchType, $hiddenFilters); ?> <?php if ($this->searchType == 'advanced'): ?> @@ -52,7 +53,11 @@ 'search/filters.phtml', [ 'params' => $params ?? null, - 'urlQuery' => isset($results) ? $results->getUrlQuery() : null + 'urlQuery' => isset($results) ? $results->getUrlQuery() : null, + 'filterList' => $showFilters ? $filterList : [], + 'checkboxFilters' => $showFilters ? $checkboxFilters : [], + 'searchClassId' => $this->searchClassId, + 'searchType' => $this->searchType, ] );?> <?php if (!empty($tabs)): ?></div><?php endif; ?> @@ -140,7 +145,11 @@ 'search/filters.phtml', [ 'params' => $params ?? null, - 'urlQuery' => isset($results) ? $results->getUrlQuery() : null + 'urlQuery' => isset($results) ? $results->getUrlQuery() : null, + 'filterList' => $showFilters ? $filterList : [], + 'checkboxFilters' => $showFilters ? $checkboxFilters : [], + 'searchClassId' => $this->searchClassId, + 'searchType' => $this->searchType, ] );?> </form>