Skip to content

Commit

Permalink
ListView: add called collection
Browse files Browse the repository at this point in the history
idea from @michaelkubina
see: kitodo#918
  • Loading branch information
BFallert authored and BFallert committed May 22, 2024
1 parent 6f570be commit 7757330
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/ListViewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,6 @@ public function mainAction(): void
$this->view->assign('lastSearch', $this->searchParams);
$this->view->assign('sortableMetadata', $sortableMetadata);
$this->view->assign('listedMetadata', $listedMetadata);
$this->view->assign('currentCollection', $collection);
}
}
41 changes: 33 additions & 8 deletions Resources/Private/Templates/ListView/Main.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,40 @@
data-namespace-typo3-fluid="true">

<div class="tx-dlf-listview">
<f:if condition="{lastSearch.collection}">
<f:then>
<f:for each="{currentCollection}" as="currentCollectionItem">
<div class="collection">
<f:if condition="{currentCollectionItem.label}">
<h2>{currentCollectionItem.label}</h2>
</f:if>

<h2 class="tx-dlf-listview-label">
<f:translate key="search.search" />
<f:translate key="search.for" arguments="{0: '{lastSearch.query}'}" />
<f:comment>
We need an ViewHelper to get the Extbase document object here. Usable e.g. on search in a newspaper title.
<f:translate key="search.in" arguments="{0: '{lastSearch.documentId}'}" />
</f:comment>
</h2>
<div class="collection-thumbnail">
<f:if condition="{currentCollectionItem.thumbnail}">
<f:image image="{currentCollectionItem.thumbnail}" />
</f:if>
</div>

<div class="collection-description">
<f:if condition="{currentCollectionItem.description}">
<f:format.html>{currentCollectionItem.description}</f:format.html>
</f:if>
</div>
</div>
</f:for>

</f:then>
<f:else>
<h2 class="tx-dlf-listview-label">
<f:translate key="search.search" />
<f:translate key="search.for" arguments="{0: '{lastSearch.query}'}" />
<f:comment>
We need an ViewHelper to get the Extbase document object here. Usable e.g. on search in a newspaper title.
<f:translate key="search.in" arguments="{0: '{lastSearch.documentId}'}" />
</f:comment>
</h2>
</f:else>
</f:if>
<f:render partial="ListView/SearchHits" arguments="{_all}" />

<f:variable name="action" value="main" />
Expand Down

0 comments on commit 7757330

Please sign in to comment.