Bug 27035: Shows the number of results in a facets after facet selection
authorShi Yao Wang <shiyao@inlibro.com>
Wed, 23 Mar 2022 19:31:40 +0000 (15:31 -0400)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 12 Apr 2022 09:40:17 +0000 (11:40 +0200)
System preferences:
displayFacetCount - Show;

1. Let's search
2. Near to each of the facets, we see the number of results (n)
3. Click on any of the facets and filter the result
4. Opposite the selected facets, the number of results is not displayed
Ex.
Marriage Fiction [x]

Apply the patch
1. Let's search
2. Near to each of the facets, we see the number of results (n)
3. Click on any of the facets and filter the result
4. Now, opposite the selected facets, the number of results is displayed
Ex.
Marriage Fiction (2) [x]

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc

index dad168a..5e6e638 100644 (file)
@@ -53,6 +53,9 @@
                                   [% IF facet.active %]
                                     [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _  facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
                                     <span class="facet-label">[% facet.facet_label_value | html %]</span>
+                                    [% IF ( displayFacetCount ) %]
+                                      <span class="facet-count-selected">([% facet.facet_count | html %])</span>
+                                    [% END %]
                                     [<a href="[% local_url | $raw %]" title="Remove facet [% facet.facet_link_value | html %]">x</a>]
                                   [% ELSE %]
                                     [% local_url = BLOCK %][% url | $raw %][% "&limit=" _  facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]