Skip to content

Commit

Permalink
Rename page search param
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Dec 11, 2024
1 parent 90f93ab commit 7079609
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Classes/Controller/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public function indexAction(array $searchParams = []): ResponseInterface
$language = $this->request->getAttribute('language');
$locale = $language->getLocale();
if (
isset($searchParams['searchParamsPage']) &&
(int) $searchParams['searchParamsPage'] > 0
isset($searchParams['page']) &&
(int) $searchParams['page'] > 0
) {
$currentPage = (int) $searchParams['searchParamsPage'];
$currentPage = (int) $searchParams['page'];
} else {
$currentPage = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/FilterBlock.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="filter-block frame">
<h4 class="">{key}</h4>
<f:variable name="searchParamsFilterKey">f_{key}</f:variable>
<f:variable name="paramsRemovePage">{lc:searchParams(action: 'remove', searchParamsArray: searchParams, key: 'searchParamsPage')}</f:variable>
<f:variable name="paramsRemovePage">{lc:searchParams(action: 'remove', searchParamsArray: searchParams, key: 'page')}</f:variable>
<f:variable name="searchParamsFromFirstPage">{paramsRemovePage.searchParams}</f:variable>
<ul>
<f:for each="{filterGroup.buckets}" as="filter">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Pagination.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</span>
</f:then>
<f:else>
<f:link.action action="index" controller="Search" pluginName="SearchListing" arguments="{lc:searchParams(action: 'add', searchParamsArray: searchParams, key: 'searchParamsPage', value: page.page)}" additionalAttributes="{f:if(condition: '{page.class} == {currentString}', then: '{aria-current: \'page\', aria-label: \'{f:translate(key: \\\'searchResults_pagination_currentPage\\\', arguments: {0: page.page}, extensionName: \\\'liszt_common\\\')}\' }', else:'{aria-label: \'{f:translate(key: \\\'searchResults_pagination_gotoPage\\\', arguments: {0: page.page}, extensionName: \\\'liszt_common\\\')}\' }' )}">
<f:link.action action="index" controller="Search" pluginName="SearchListing" arguments="{lc:searchParams(action: 'add', searchParamsArray: searchParams, key: 'page', value: page.page)}" additionalAttributes="{f:if(condition: '{page.class} == {currentString}', then: '{aria-current: \'page\', aria-label: \'{f:translate(key: \\\'searchResults_pagination_currentPage\\\', arguments: {0: page.page}, extensionName: \\\'liszt_common\\\')}\' }', else:'{aria-label: \'{f:translate(key: \\\'searchResults_pagination_gotoPage\\\', arguments: {0: page.page}, extensionName: \\\'liszt_common\\\')}\' }' )}">
{page.page}
</f:link.action>
</f:else>
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Templates/Search/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</div>

<f:comment>Remove Page param from searchparams array for display filter tags</f:comment>
<f:variable name="paramsRemovePage">{lc:searchParams(action: 'remove', searchParamsArray: searchParams, key: 'searchParamsPage')}</f:variable>
<f:variable name="paramsRemovePage">{lc:searchParams(action: 'remove', searchParamsArray: searchParams, key: 'page')}</f:variable>
<f:if condition="{paramsRemovePage.searchParams}">
<div class="searchresults-filtertags" aria-label="{f:translate(key: 'searchResults_params_label', extensionName: 'liszt_common')}" role="navigation" >
<f:for each="{paramsRemovePage.searchParams}" key="key" as="searchParam">
Expand Down

0 comments on commit 7079609

Please sign in to comment.