index-main/site/snippets/nav.php
isUnknown 3f3fb53f02 feat(search): add keyword autocomplete to search field
Add HTML5 datalist autocomplete to search input using keywords from
database page. Users will see keyword suggestions as they type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-10 16:23:48 +01:00

32 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div id="site-menu">
<p class="baseline">Index est une ONG dinvestigation numérique au service du public,
de la vérité et de la justice.</p>
<form aria-label="Formulaire de recherche" class="search-form">
<span class="icon"><?= svg('assets/icons/search.svg') ?></span>
<input type="text" id="search" class="input" placeholder="Rechercher" list="keywords-list">
<datalist id="keywords-list">
<?php foreach (page('database')->keywords()->split() as $keyword): ?>
<option value="<?= esc($keyword) ?>">
<?php endforeach ?>
</datalist>
</form>
<nav>
<ul>
<li class="soutenir highlight"><a href="#">Soutenez-nous</a></li>
<li class="highlight"><a href="/enquetes">Enquêtes</a></li>
<li class="highlight"><a href="/impacts">Impact</a></li>
<li><a href="/dossiers">Dossiers</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">À propos</a></li>
<li><a href="#">Ressources</a></li>
<li><a href="#">Newsletter</a></li>
<li><a href="#">Mentions légales</a></li>
</ul>
</nav>
<?php snippet('socials') ?>
</div>