Added highlighting for selected category
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user