Added highlighting for selected category

This commit is contained in:
2024-01-06 01:14:20 +00:00
parent a86edf01ad
commit 20f28739a2
14 changed files with 278 additions and 183 deletions

View File

@@ -14,12 +14,14 @@
<centre>
<div class="categories">
<a href="/products/CarParts" class="category">Car Parts</a>
<a href="/products/Animals" class="category">Animals</a>
<a href="/products/Sports" class="category">Sports</a>
<a href="/products/Books" class="category">Books</a>
<a href="/products/Phones" class="category">Phones</a>
<a href="/products/Music" class="category">Music</a>
{# List all categories and ensure the selected one is highlighted #}
{% for c in categories %}
{% if category == c.name %}
<a style="color: cyan" href="/products/{{c.name}}" class="category">{{c.name}}</a>
{% else %}
<a href="/products/{{c.name}}" class="category">{{c.name}}</a>
{% endif %}
{% endfor %}
</div>
</centre>
</div>