Skip to content

Commit

Permalink
Introduce results-list template between results and list templates.
Browse files Browse the repository at this point in the history
This paves way for extended use (i.e. the possibility of rendering search results without the surrounding controls).
  • Loading branch information
EreMaijala committed Aug 14, 2023
1 parent 1bc1f33 commit 7540f53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 9 additions & 0 deletions themes/bootstrap3/templates/search/results-list.phtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
// Create a css class for results from the search class:
$searchClass = $searchClassCss = $this->params->getSearchClassId();
if (!ctype_upper($searchClassCss)) {
$searchClassCss = preg_replace('/([a-zA-Z])(?=[A-Z])/', '$1-', $searchClassCss);
}
$this->resultsClass = 'search-results-' . strtolower($searchClassCss);
?>
<?=$this->render('search/list-' . $this->params->getView() . '.phtml')?>
8 changes: 1 addition & 7 deletions themes/bootstrap3/templates/search/results.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -107,7 +101,7 @@
<form id="search-cart-form" method="post" name="bulkActionForm" action="<?=$this->url('cart-searchresultsbulk')?>" data-lightbox data-lightbox-onsubmit="bulkFormHandler">
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => ''])?>
</form>
<?=$this->render('search/list-' . $this->params->getView() . '.phtml')?>
<?=$this->render('search/results-list.phtml')?>
<?=$this->context($this)->renderInContext('search/bulk-action-buttons.phtml', ['idPrefix' => 'bottom_', 'formAttr' => 'search-cart-form'])?>
<?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results, 'options' => $this->paginationOptions ?? []])?>
<?=$this->context($this)->renderInContext('search/controls/results-tools.phtml', ['results' => $this->results])?>
Expand Down

0 comments on commit 7540f53

Please sign in to comment.