Hi there, I’m currently building a search engine for a website I’m making.
The issue is whenever I click on the search tab the “No Results Found” message immediately appears. How do I make it so that it appears only after someone has used the search bar?
I’m using the code found on Kirby’s Documentation Page and code found on this solution.
<?php if($results->count()) : ?>
<ul class="searchresults">
<?php foreach($results as $result): ?>
<li>
<a href="<?php echo $result->url() ?>">
<?php echo $result->title()->html() ?>
</a>
</li>
<?php endforeach ?>
</ul>
<?php else : ?>
<p>There are no results</p>
<?php endif ?>