From 7540f5358e0b623db125a74df691f03992dbb16c Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Mon, 14 Aug 2023 15:33:49 +0300 Subject: [PATCH] Introduce results-list template between results and list templates. This paves way for extended use (i.e. the possibility of rendering search results without the surrounding controls). --- themes/bootstrap3/templates/search/results-list.phtml | 9 +++++++++ themes/bootstrap3/templates/search/results.phtml | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 themes/bootstrap3/templates/search/results-list.phtml diff --git a/themes/bootstrap3/templates/search/results-list.phtml b/themes/bootstrap3/templates/search/results-list.phtml new file mode 100644 index 00000000000..db247596357 --- /dev/null +++ b/themes/bootstrap3/templates/search/results-list.phtml @@ -0,0 +1,9 @@ +params->getSearchClassId(); + if (!ctype_upper($searchClassCss)) { + $searchClassCss = preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $searchClassCss); + } + $this->resultsClass = 'search-results-' . strtolower($searchClassCss); +?> +render('search/list-' . $this->params->getView() . '.phtml')?> diff --git a/themes/bootstrap3/templates/search/results.phtml b/themes/bootstrap3/templates/search/results.phtml index b79c73c16d5..4415ae5917c 100644 --- a/themes/bootstrap3/templates/search/results.phtml +++ b/themes/bootstrap3/templates/search/results.phtml @@ -37,12 +37,6 @@ && ($this->showBulkOptions || !$this->cart()->isActiveInSearch()); // Enable bulk options if appropriate: $this->showCheckboxes = $this->showCartControls || $this->showBulkOptions; - // Create a css class for results from the search class: - $searchClass = $this->params->getSearchClassId(); - if (!ctype_upper($searchClass)) { - $searchClass = preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $searchClass); - } - $this->resultsClass = 'search-results-' . strtolower($searchClass); $this->render( 'search/results-scripts.phtml', @@ -107,7 +101,7 @@
context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => ''])?>
- render('search/list-' . $this->params->getView() . '.phtml')?> + render('search/results-list.phtml')?> context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?> paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => $this->paginationOptions ?? []])?> context($this)->renderInContext('search/controls/results-tools.phtml', ['results' => $this->results])?>