Commit 4bc56018 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch 'develop' into 'main'

Release 20-06-22

See merge request !492
parents 75148445 643a5224
Pipeline #28269 passed with stages
in 6 minutes and 19 seconds
...@@ -29,7 +29,6 @@ use Psr\Http\Server\RequestHandlerInterface; ...@@ -29,7 +29,6 @@ use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Http\HtmlResponse; use TYPO3\CMS\Core\Http\HtmlResponse;
use TYPO3\CMS\Core\Http\JsonResponse; use TYPO3\CMS\Core\Http\JsonResponse;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\View\StandaloneView;
class SolrSearch implements MiddlewareInterface class SolrSearch implements MiddlewareInterface
...@@ -92,7 +91,6 @@ class SolrSearch implements MiddlewareInterface ...@@ -92,7 +91,6 @@ class SolrSearch implements MiddlewareInterface
return $response; return $response;
} }
$searchResultSetService = GeneralUtility::makeInstance(SearchResultSetService::class, $typoscriptConfiguration, $search); $searchResultSetService = GeneralUtility::makeInstance(SearchResultSetService::class, $typoscriptConfiguration, $search);
$searchResultSetService->injectObjectManager(GeneralUtility::makeInstance(ObjectManager::class));
$searchResultSet = $searchResultSetService->search($searchRequest); $searchResultSet = $searchResultSetService->search($searchRequest);
if ($queryParams['ajaxsearch'] === 'raw') { if ($queryParams['ajaxsearch'] === 'raw') {
......
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" <html
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers" xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/"> lang="en"
xmlns:f="http://typo3.org/ns/TYPO3/Fluid/ViewHelpers"
xmlns:s="http://typo3.org/ns/ApacheSolrForTypo3/Solr/ViewHelpers/"
>
<f:layout name="Main"/> <f:layout name="Main"/>
...@@ -8,7 +11,16 @@ ...@@ -8,7 +11,16 @@
<div id="tx-solr-search"> <div id="tx-solr-search">
<f:render partial="Search/Form" section="Form" arguments="{search:search, additionalFilters:additionalFilters, pluginNamespace: pluginNamespace, resultSet: resultSet}" /> <f:render
partial="Search/Form"
section="Form"
arguments="{
search: search,
additionalFilters: additionalFilters,
pluginNamespace: pluginNamespace,
resultSet: resultSet
}"
/>
<f:if condition="{resultSet.isAutoCorrected}"> <f:if condition="{resultSet.isAutoCorrected}">
<f:then> <f:then>
...@@ -17,7 +29,6 @@ ...@@ -17,7 +29,6 @@
<s:translate key="no_results_search_for_original" arguments="{0: resultSet.correctedQueryString}">Search instead for "%s".</s:translate> <s:translate key="no_results_search_for_original" arguments="{0: resultSet.correctedQueryString}">Search instead for "%s".</s:translate>
</span> </span>
</f:then> </f:then>
<f:else> <f:else>
<f:if condition="{resultSet.usedQuery.keywordsCleaned}"> <f:if condition="{resultSet.usedQuery.keywordsCleaned}">
<span class="searched-for"> <span class="searched-for">
...@@ -30,9 +41,13 @@ ...@@ -30,9 +41,13 @@
<f:if condition="{resultSet.hasSpellCheckingSuggestions}"> <f:if condition="{resultSet.hasSpellCheckingSuggestions}">
<f:then> <f:then>
<s:translate key="didYouMean">Did you mean</s:translate> <s:translate key="didYouMean">Did you mean</s:translate>
<f:for each="{resultSet.spellCheckingSuggestions}" as="suggestion"> <f:for each="{resultSet.spellCheckingSuggestions}" as="suggestion">
<f:link.page additionalParams="{q:suggestion.suggestion}">{suggestion.suggestion}</f:link.page> <f:link.page additionalParams="{q:suggestion.suggestion}">
</f:for> ? {suggestion.suggestion}
</f:link.page>
</f:for>
?
</f:then> </f:then>
</f:if> </f:if>
...@@ -49,36 +64,68 @@ ...@@ -49,36 +64,68 @@
</f:if> </f:if>
<f:if condition="{resultSet.hasSearched}"> <f:if condition="{resultSet.hasSearched}">
<div class="container search-filter mb-4"> <div class="container search-filter my-4">
<div class="row"> <f:if condition="{resultSet.searchResults}">
<div class="col-12"> <f:then>
<f:variable name="facetUsed" value="0" /> <div class="row">
<f:for each="{resultSet.facets}" as="facet"> <div class="col-12">
<f:if condition="{facet.isUsed}"> <f:variable name="facetUsed" value="0" />
<f:variable name="facetUsed" value="1" />
</f:if> <f:for each="{resultSet.facets}" as="facet">
</f:for> <f:if condition="{facet.isUsed}">
<ul class="nav nav-tabs nav-fill"> <f:variable name="facetUsed" value="1"/>
<li class="nav-item"> </f:if>
<a href="{s:uri.facet.removeAllFacets()}" class="nav-link{f:if(condition:'{facetUsed}', else:' active')}""> </f:for>
All
<span class="badge badge-dark">{allResultCountWithoutFacets}</span> <ul class="nav nav-tabs nav-fill">
</a> <li class="nav-item">
</li> <a href="{s:uri.facet.removeAllFacets()}" class="nav-link{f:if(condition:'{facetUsed}', else:' active')}">
<f:if condition="{resultSet.hasSearched}"> All
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}"> <span class="badge badge-dark">{allResultCountWithoutFacets}</span>
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" /> </a>
</f:if> </li>
</f:if>
</ul> <f:if condition="{resultSet.hasSearched}">
</div> <f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
</div> <f:render
<ol start="{pagination.displayRangeStart}" class="results-list"> partial="Result/Facets"
<f:for each="{resultSet.searchResults}" as="document"> section="Facets"
<f:render partial="Result/Document" section="Document" arguments="{resultSet:resultSet, document:document}" /> arguments="{resultSet:resultSet}"
</f:for> />
<f:render partial="Result/Pagination" section="Pagination" arguments="{resultSet: resultSet, pagination: pagination, currentPage: currentPage}" /> </f:if>
</ol> </f:if>
</ul>
</div>
</div>
<ol start="{pagination.displayRangeStart}" class="results-list">
<f:for each="{resultSet.searchResults}" as="document">
<f:render
partial="Result/Document"
section="Document"
arguments="{
resultSet: resultSet,
document: document
}"
/>
</f:for>
<f:render
partial="Result/Pagination"
section="Pagination"
arguments="{
resultSet: resultSet,
pagination: pagination,
currentPage: currentPage
}"
/>
</ol>
</f:then>
<f:else>
<h2>No search results found.</h2>
</f:else>
</f:if>
</div>
</f:if> </f:if>
</div> </div>
...@@ -86,18 +133,35 @@ ...@@ -86,18 +133,35 @@
<div id="tx-solr-search-functions"> <div id="tx-solr-search-functions">
<f:if condition="{hasSearched}"> <f:if condition="{hasSearched}">
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchSorting}"> <f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchSorting}">
<f:render partial="Result/Sorting" section="Sorting" arguments="{resultSet:resultSet}" /> <f:render
partial="Result/Sorting"
section="Sorting"
arguments="{resultSet: resultSet}"
/>
</f:if> </f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}"> <f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFaceting}">
<f:render partial="Result/Facets" section="Facets" arguments="{resultSet:resultSet}" /> <f:render
partial="Result/Facets"
section="Facets"
arguments="{resultSet: resultSet}"
/>
</f:if> </f:if>
</f:if> </f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchLastSearches}"> <f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchLastSearches}">
<f:render partial="Search/LastSearches" section="LastSearches" arguments="{resultSet:resultSet}" /> <f:render
partial="Search/LastSearches"
section="LastSearches"
arguments="{resultSet: resultSet}"
/>
</f:if> </f:if>
<f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFrequentSearches}"> <f:if condition="{resultSet.usedSearchRequest.contextTypoScriptConfiguration.searchFrequentSearches}">
<f:render partial="Search/FrequentlySearched" section="FrequentlySearched" /> <f:render
partial="Search/FrequentlySearched"
section="FrequentlySearched"
/>
</f:if> </f:if>
</div> </div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment