{%- liquid comment Get each resource's result count endcomment assign query_count = predictive_search.resources.queries.size assign product_count = predictive_search.resources.products.size assign collection_count = predictive_search.resources.collections.size assign article_count = predictive_search.resources.articles.size assign page_count = predictive_search.resources.pages.size assign collection_counter = 0 assign total_results_counter = 0 assign terms = predictive_search.terms -%} {%- if collection_count > 0 -%} {%- liquid assign exclude_collections_strict = settings.exclude_collections_strict | split: ',' assign exclude_collections_contain = settings.exclude_collections_contain | split: ',' assign collections_markup = '' -%} {%- for collection in predictive_search.resources.collections -%} {%- liquid assign skip_current_collection = false for exclude_collection_strict in exclude_collections_strict assign exclude_collection_strict_stripped = exclude_collection_strict | strip if exclude_collection_strict_stripped == collection.handle assign skip_current_collection = true break endif endfor for exclude_collection_contain in exclude_collections_contain assign exclude_collection_contain_stripped = exclude_collection_contain | strip if collection.handle contains exclude_collection_contain_stripped assign skip_current_collection = true break endif endfor if skip_current_collection continue endif assign collection_counter = collection_counter | plus: 1 assign collection_counter_animate = collection_counter | plus: product_count | plus: query_count -%} {%- capture collections_markup -%} {{ collections_markup }}

{{ collection.title }}

{%- endcapture -%} {%- endfor -%} {%- endif -%} {%- assign total_results = product_count | plus: query_count | plus: collection_counter | plus: page_count | plus: article_count -%} {%- if predictive_search.performed -%}
{%- liquid if total_results == 0 echo 'general.search.no_results' | t: terms: terms else echo 'general.search.results_with_count' | t: count: total_results | replace: '**', '' | append: ': ' if query_count > 0 assign count = query_count | plus: collection_counter echo 'general.search.results_suggestions_with_count' | t: count: count | append: ', ' endif if page_count > 0 assign count = page_count | plus: article_count echo 'general.search.results_pages_with_count' | t: count: count | append: ', ' endif if product_count > 0 echo 'general.search.results_products_with_count' | t: count: product_count endif endif -%}
{%- if total_results > 0 -%}
{%- if query_count > 0 -%}

{{ 'general.search.suggestions' | t }}

{{ query_count }}
    {%- for query in predictive_search.resources.queries -%} {%- assign total_results_counter = total_results_counter | plus: 1 -%}
  • {{ query.styled_text }}

  • {%- endfor -%}
{%- endif -%} {%- if product_count > 0 -%}

{{ 'products.general.products' | t }}

{{ product_count }}
{%- endif -%} {%- if collection_counter > 0 -%} {%- assign total_results_counter = total_results_counter | plus: collection_counter -%}

{{ 'collections.sidebar.collections' | t }}

{{ collection_counter }}
    {{ collections_markup }}
{%- endif -%} {%- if article_count > 0 -%}

{{ 'blogs.article.articles' | t }}

{{ article_count }}
    {%- for article in predictive_search.resources.articles -%} {%- assign total_results_counter = total_results_counter | plus: 1 -%}
  • {{ article.title }}

  • {%- endfor -%}
{%- endif -%} {%- if page_count > 0 -%}

{{ 'general.page.pages' | t }}

{{ page_count }}
    {%- for page in predictive_search.resources.pages -%} {%- assign total_results_counter = total_results_counter | plus: 1 -%}
  • {{ page.title }}

  • {%- endfor -%}
{%- endif -%}
{%- else -%}

{{ 'general.search.no_results_for' | t }} {{ terms }}

{%- endif -%}
{%- endif -%}