Skip to content

Commit

Permalink
tests with searchBar from liszt_common Module
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-sc committed May 22, 2024
1 parent c3e0454 commit b6dbe77
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
5 changes: 4 additions & 1 deletion Classes/Controller/BibliographyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Slub\LisztBibliography\Interfaces\ElasticSearchServiceInterface;

use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Extbase\Persistence\ObjectStorage;

final class BibliographyController extends ClientEnabledController
{
Expand All @@ -33,7 +34,6 @@ final class BibliographyController extends ClientEnabledController
protected int $resultLimit;



// Dependency Injection of Repository
// https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/DependencyInjection/Index.html#Dependency-Injection

Expand All @@ -58,6 +58,9 @@ public function searchAction(): ResponseInterface

$this->view->assign('totalItems', $elasticResponse['hits']['total']['value']);

$searchParams = $this->request->getQueryParams();
$this->view->assign('searchParams', $searchParams);


$this->view->assign('bibliographyList', $elasticResponse);
return $this->htmlResponse();
Expand Down
24 changes: 16 additions & 8 deletions Configuration/TypoScript/setup.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,27 @@

// @import 'EXT:liszt_common/Configuration/TypoScript/setup.typoscript'

lib.contentElement {
#layoutRootPaths {
#200 = EXT:liszt_bibliography:Resources/Private/Layouts
#}
#partialRootPaths {
#200 = EXT:liszt_bibliography:Resources/Private/Partial
#}

// ToDo: Frage Matthias warum doppelt?
/*lib.contentElement {
layoutRootPaths {
100 = EXT:liszt_bibliography/Resources/Private/Layouts/
20 = EXT:liszt_web/Resources/Private/Layouts/

}
templateRootPaths {
200 = EXT:liszt_bibliography/Resources/Private/Templates
100 = EXT:liszt_bibliography/Resources/Private/Templates/
}
partialRootPaths {
20 = EXT:liszt_web/Resources/Private/Partials/
100 = EXT:liszt_bibliography/Resources/Private/Partials/
}
}





// ToDo: needed?
tt_content {
lisztbibliography_listing =< lib.contentElement
Expand Down
22 changes: 22 additions & 0 deletions Resources/Private/Layouts/Testtemplate.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<f:spaceless>
<a class="visually-hidden-focusable" href="#page-content"><span>Zum Hauptinhalt springen</span></a>


<f:render partial="MainNav" arguments="{_all}" />

<f:comment><!-- Don't show Searchbar if Frontend Layout 4 is selected, changed from != to == --></f:comment>
<f:if condition="{selectedFrontendLayout} != '4'">
<f:render partial="SearchBar" arguments="{_all}" />
</f:if>

<f:render section="Header" optional="true" />
<f:render section="Main"/>

<f:render partial="Footer" arguments="{_all}" />

<f:render partial="QuickMenu"/>

</f:spaceless>
</html>
4 changes: 3 additions & 1 deletion Resources/Private/Templates/Bibliography/Search.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">

<f:debug>{_all}</f:debug>

searchTerm:
{searchParams.tx_liszt_bibliography_searchbar.searchForm.searchTerm}

<div class="row" style="margin-top: 3rem;">
<div class="col-12 col-md-3 col-lg-2 ">
Expand Down

0 comments on commit b6dbe77

Please sign in to comment.