Bring no (empty) results text into alignment with D8 and/or make customizable

Created on 21 May 2016, about 8 years ago
Updated 27 February 2024, 4 months ago

Presently Search404 provides the heading "Your search yielded no results." (which is the same as Drupal 8 core) and also adds the following text (which is now particular to, and particularly inappropriate for, Search404):

  • Check if your spelling is correct.
  • Remove quotes around phrases to search for each word individually. bike shed will often show more results than "bike shed".
  • Consider loosening your query with OR. bike OR shed will often show more results than bike shed.

Drupal 8 core refrains from giving this advice when a search returns empty results. In the case of Search404, this text amounts to blaming the victim who just followed a broken link!

Possible solutions

  1. Add template suggestions specific to item_list/item_list__search_results for search404 so that if nothing else empty text can be suppressed altogether. This is probably a good idea anyway and i'll include a patch.
  2. Do what core does by default (no further explanatory text about the non-result).
  3. Allow the text that substitutes for empty results to be customized.

I'm in favor of all three and will work on patches if maintainers and other interested parties are in favor.

If there's some way that Drupal 8 core is allowing empty search results replacement text to be customized, that should be brought in, but i dont even know if that's done, let alone how to get it.

Also, if we're going to have any text in place of zero search results, it makes more sense for that to be something like "Sorry we couldn't find what you were looking for. It might still be in the site somewhereโ€” you can try searching for it with different keywords."

โœจ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

Sign in to follow issues

Merge Requests

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.69.0 2024