bolt / docs

Documentation for Bolt.
45 stars 193 forks source link

Example {{ searchresult.no_of_results }} does not work #1269

Open peterboorsma opened 2 years ago

peterboorsma commented 2 years ago

On this page: https://docs.boltcms.io/5.0/templating/content-search#setcontent-search

is an example usecase:

{% if records|length == 0 %}
    <p>
        {{ searchresult.no_of_results }} results for {{ searchTerm }} found.
    </p>
{% else %}
...
{% endif %}

But {{ searchresult.no_of_results }} returns an error: Variable "searchresult" does not exist.

shadowbytefox commented 1 year ago

Hey @peterboorsma :)

Can you show us how you invoke the search and what your configuration looks like for the global search?