Allow for "result(s) found" text to be configurable in the settings

Created on 23 September 2022, about 2 years ago
Updated 19 January 2023, almost 2 years ago

Problem/Motivation

facets-summary-count.html.twig has "1 result found" and "{{ count }} results found". I have multiple facet summaries, that need to have different text per facet summary. Example:

  1. {{ count }} Programs Found
  2. {{ count }} Schools Found
  3. {{ count }} Policies Found

I don't want to maintain multiple twig files that have the same html except for {{ result_name }} being different.

Steps to reproduce

Create 2 facet summaries that include "Show a summary of how many results were found" being checked". Update facets-summary-count.html.twig to confirm both facet summaries have the update.

Proposed resolution

Update ShowSummaryProcessor.php to include 2 new fields.

  1. result_name_singular - default of "result found"
  2. result_name_plural - default of "results found"

Remaining tasks

  1. done-Code a proof of concept for review
  2. Update checkShowCountProcessor() in IntegrationTest.php
  3. Make sure existing facet summaries don't have any changes

User interface changes

New admin fields (2) if a facet summary show result count is selected.

API changes

None

Data model changes

2 extra fields would be added to config

✨ Feature request
Status

Needs review

Version

2.0

Component

Facet summary

Created by

πŸ‡ΊπŸ‡ΈUnited States nmillin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024