Hide the block when the view has no results

Created on 9 May 2019, over 5 years ago
Updated 31 October 2024, about 1 month ago

If the view has no results do display the sort block is show anyway. T

here should be an option to hide it in that case?

Thanks.

Feature request
Status

Needs work

Version

1.0

Component

User interface

Created by

🇵🇹Portugal introfini

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.

  • 🇪🇸Spain aleix

    Excuse the necrobump, not exactly what is looking for, but I want to be disabled if no query has been made, so it could be based on this to disable if no results.

    So just for future references setting a flag like:

    function yourtheme_preprocess_search_api_sorts_sort(&$variables) {
      $variables["searching"] = !empty(\Drupal::request()->query->all());
    }

    make it possible to wrap sorts links in template search-api-sorts-sort.html.twig

    {% if searching %}
      <button ...>
    {% endif %}
Production build 0.71.5 2024