Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

28 multiple facettes selectable #40

Merged
merged 3 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Classes/Common/QueryParamsBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ private static function retrieveFilterParamsForEntityType(
// show docs with count 0 only for multiple select fields
'min_doc_count' => $entityTypeMultiselect ? 0 : 1,
'size' => $entityTypeSize,
// 'include' => 'Slowakisch|.*',

]
]
],
Expand Down
5 changes: 5 additions & 0 deletions Classes/ViewHelpers/ProcessFacetsViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ public static function renderStatic(
return $item['doc_count'] > 0 || ($item['selected'] ?? false);
});

// Sort the array so that selected items come first
usort($returnBucket, function ($a, $b) {
return ($b['selected'] ?? false) <=> ($a['selected'] ?? false);
});

return $returnBucket;

}
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 @@ -8,7 +8,7 @@
<f:if condition="{buckets -> f:count()} > 0">
<div class="filter-block frame">
<h4 class="">{f:translate(key: '{languageFilePath}:{key}', default: '{key}')}</h4>
<ul>
<ul style="view-transition-name:filterblock-{key};">
<f:for each="{buckets}" as="filter">
<f:render partial="FilterBlockItem" arguments="{key: key, filter: filter, searchParams: searchParams, searchParamsFromFirstPage: searchParamsFromFirstPage, languageFilePath: languageFilePath}" />
</f:for>
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Templates/Search/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<div class="searchresults-info frame">
<div class="searchresults-info-total">
<output class="searchresults-total-items">{totalItems} {f:translate(key: 'searchResults_hits_label', extensionName: 'liszt_common')}</output>
<button class="filter-toggler btn" type="button" data-bs-toggle="offcanvas" data-bs-target="#filter-container" aria-controls="filter-container">
{f:translate(key: 'filter_container_label', extensionName: 'liszt_common')}
<button class="filter-toggler btn btn-black" type="button" data-bs-toggle="offcanvas" data-bs-target="#filter-container" aria-controls="filter-container">
<i:icon iconfig="lzicon,filter" preferredRenderTypes="svgSprite" additionalAttributes="{aria-hidden:'true'}" /> {f:translate(key: 'filter_container_label', extensionName: 'liszt_common')}
</button>
</div>

Expand Down